Re: mysql+php query
| From: | Bobo Wieland | Date: | Wed, 10 Sep 2003 13:16:50 +0000 |
| Subject: | Re: mysql+php query | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-21342@lists.php.net to get a copy of this message | ||
$SQL = "SELECT 'password' FROM 'table' WHERE 'username' =
'".$user."';";
$result = mysql_query($db,$SQL,$cid);
With the above you then do a:
$pass = mysql_fetch_object($result);
$pass->passord //is the password then...
.bobo
----- Original Message -----
From: "Exiang" <allentan@pd.jaring.my>
To: <php-windows@lists.php.net>
Sent: Wednesday, September 10, 2003 3:00 PM
Subject: [PHP-WIN] mysql+php query
Hi, i hav a problem query a data value from my database
every setting is fine. the database is working too.just i dunno how to do it
with php
let say i hav a username and a password in my database
i wanto query the password with given username
$SQL = "SELECT
password FROM table WHERE username =
'$user';";
$result = mysql_db_query($db,"$SQL",$cid);
but the result i hav is a Resource id #4 but not the value of password that
i wan.
Pls help me..thanx.