Not sure if anyone can help me out here but I have an app that I am trying to connect to mysql database so information can be updated and stored. I have created a registration page in java and have it connecting through PHP. When I fill out the registration page however my exception error is displayed and no information is passed to the database. My java code has been examined and people informed me it is correct. I am using a WAMP server to test the app.

Here is my PHP

mysql_query("INSERT INTO tbl_users (UserName, Password, email) VALUES     ('".$UserName."', '".$Password."', '".$email."')";
$query_exec = mysql_query($query_insert) or die (mysql_error());
$rows = mysql_num_rows($query_exec);

if($rows !==0) {echo "Y"};
else {echo "N"};
?>

<?php
$hostname_localhost = "localhost";
$database_localhost = "logindatabase";
$username_localhost = "root";

$localhost = mysql_connect($hostname_localhost,$username_localhost)
or
trigger_error(mysql_error(),E_USER_ERROR);
link|improve this question
Why dont' you connect directly to MySQL from java? – ErikA Jan 16 at 16:49
i was told couldnt directly connect to mysql from android/java – jp009 Jan 16 at 19:00
Well, what does the exception provide of information ? What is in your mysql logs ? – Lucas Kauffman Jan 17 at 16:31
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.