Posted by Jerry Stuckle on 07/24/06 18:03
chsadaki@hotmail.com wrote:
> Hello
> I have a problem in retrieving a row form a table that I created in
> mysql db.
> I insert these values in the table
> 'Bell',password('123').
> But the problem is in my php application I cant retrieve this row
> because the password that I pass dosn't match the password value in the
> table.
> this is the code that I wrote in my php application
>
> $user = $_POST[username];
> $pass = $_POST[password];
> $q = mysql_query("SELECT * FROM admin WHERE username = '$user' and
> password =PASSWORD('$pass')");
>
> if(mysql_num_rows($q)==0){
> echo "Acces denied. User not allowed to connect.";
> mysql_close();
> }
> else
> {
> echo
> "<script>window.location.replace('administrator2.php')</script>";
> }
>
> so if any body has an idea about this problem please tell me about it.
> thanx in advance
> Shameram Sadaki
>
How are you putting the values into the table? What versions are the
MySQL server and the client libraries you're using in PHP?
What do you get if you do echo the password in the database and the
results of PASSWORD('$pass')?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|