RE: [PHP-DB] a newbie in deep need for help
| From: | Rich Hutchins | Date: | Fri, 27 Dec 2002 19:47:03 +0000 |
| Subject: | RE: [PHP-DB] a newbie in deep need for help | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24428@lists.php.net to get a copy of this message | ||
Aha! John, you're right. I remember stumbling over this the first time I
used it. Sorry for any confusion, Ehab.
More info here:
http://www.php.net/manual/en/function.mysql-result.php
-----Original Message-----
From: John Coder [mailto:jcoder@insightbb.com]
Sent: Friday, December 27, 2002 2:09 PM
To: Ehab El Maraghy
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] a newbie in deep need for help
On Fri, 2002-12-27 at 04:19, Ehab El Maraghy wrote:
> Hi everybody
> I have installed php4 and mysql on IIs winxp
> I am trying to retrieve a password and print it using a query which is
> written as followos
>
> $query2 = "select passwd from user where username = '$username'";
> $result = mysql_result($query2);
> echo "<center><B>Old Password was $result </B></center>";
>
> am I using mysql_result right or is there another function to print this
> password taking in consideration that it just prints "Old Password was"
and
> that's it
>
If I'm not mistaken mysql_result() takes 3 arguments. try:
$select = "select passwd from user where username = '$username'";
$query2 = mysql_query($select);
$result=mysql_result($query2,0,0);
//the zeroes being the position of row and column i.e. row0 and column 0
echo $result;
John
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php