Hi guys,
I want to basically take in a username and password and then check to see if its in the mySQL database. The problem is though that I can print the variables yet when I use then in the php query the resultSet is null. If I force the values though the resultSet is not null. If anyone has any ideas on how I can fix this can you let me know ASAP.
Any help would be greatly appreciated.
Heres my code:
[PHP]
print "<wml>\n";
print "<card title=\"home\" id = \"main\">\n" ;
print "<p align = \"center\">\ n";
print "Username: <input name=\"username \" size = \"10\"/>\n";
print "</p>\n";
print "<p align = \"center\">\ n";
print "Password: <input name=\"password \" size = \"10\"/>\n";
print "</p>\n";
print "<p align = \"center\">\ n";
print "<a href=\"#results \">Submit</a>\n";
print "</p>\n";
print "</card>\n";
print "<card id=\"results\"> \n";
print "<p>\n";
print "<u>$(username) </u>\n";
print "<u>$(password) </u>\n";
print "</p>\n";
$link_id = mysql_connect(" xxxxx, "xxxxx", "xxxx");
if(mysql_select _db("xxxx", $link_id))
{
print "<p>Connect ed to MySQL database...</p>n";
$query = "SELECT cust_id FROM customer where username = '$(username)'";
$result = mysql_query($qu ery,$link_id);
$num_rows = mysql_num_rows( $result);
print "<p>$num_ro ws</p>n";
if($num_rows == 0)
{
print "<p>ERROR</p>n";
}
else
{
print "<p>OK</p>n";
}
}
else
{
print "<p>Error in connection....</p>n";
}
print "</card>n";
print "</wml>n"; [/PHP]
Thanks a million in advance,
Shauna
I want to basically take in a username and password and then check to see if its in the mySQL database. The problem is though that I can print the variables yet when I use then in the php query the resultSet is null. If I force the values though the resultSet is not null. If anyone has any ideas on how I can fix this can you let me know ASAP.
Any help would be greatly appreciated.
Heres my code:
[PHP]
print "<wml>\n";
print "<card title=\"home\" id = \"main\">\n" ;
print "<p align = \"center\">\ n";
print "Username: <input name=\"username \" size = \"10\"/>\n";
print "</p>\n";
print "<p align = \"center\">\ n";
print "Password: <input name=\"password \" size = \"10\"/>\n";
print "</p>\n";
print "<p align = \"center\">\ n";
print "<a href=\"#results \">Submit</a>\n";
print "</p>\n";
print "</card>\n";
print "<card id=\"results\"> \n";
print "<p>\n";
print "<u>$(username) </u>\n";
print "<u>$(password) </u>\n";
print "</p>\n";
$link_id = mysql_connect(" xxxxx, "xxxxx", "xxxx");
if(mysql_select _db("xxxx", $link_id))
{
print "<p>Connect ed to MySQL database...</p>n";
$query = "SELECT cust_id FROM customer where username = '$(username)'";
$result = mysql_query($qu ery,$link_id);
$num_rows = mysql_num_rows( $result);
print "<p>$num_ro ws</p>n";
if($num_rows == 0)
{
print "<p>ERROR</p>n";
}
else
{
print "<p>OK</p>n";
}
}
else
{
print "<p>Error in connection....</p>n";
}
print "</card>n";
print "</wml>n"; [/PHP]
Thanks a million in advance,
Shauna
Comment