PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
wugang_bob
Forum Newbie
Posts: 6 Joined: Thu Jun 26, 2003 8:20 pm
Post
by wugang_bob » Fri Jun 27, 2003 11:01 am
Code: Select all
<?php
$query = "select * from userid where username='" .$_REQUEST['username'] ."'";
$result=mysql_db_query($query);
if(mysql_num_rows($result)==1)
{
header("Location: fail3.php");
exit;
}
?>
else ........
Execute the above code, no error message, but it seem does not work.
Thank you
Admin Edit note: Use the PHP BBCode tags. please.
phice
Moderator
Posts: 1416 Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:
Post
by phice » Fri Jun 27, 2003 11:42 am
Be sure to add an "or die()" to your mysql_db_query function.
Code: Select all
$query = "select * from userid where username='" .$_REQUEST['username'] ."'";
$result=mysql_db_query($query) or die("<B>Unable to exicute code from the query:</B><BR>\n" . $query . "<P><B>MySQL Error given:</B><BR>\n" . mysql_error());
if(mysql_num_rows($result)==1)
{
header("Location: fail3.php");
exit;
}
Give that a try, and post back the results you get, please.
jason
Site Admin
Posts: 1767 Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:
Post
by jason » Fri Jun 27, 2003 11:43 am
What's your Query look like at runtime (echo $query;), and are there any mysql errors? (echo mysql_error(); after mysql_query()).
wugang_bob
Forum Newbie
Posts: 6 Joined: Thu Jun 26, 2003 8:20 pm
Post
by wugang_bob » Sat Jul 05, 2003 7:43 am
Now, It's work
Thank you