php-db | 2002122
Date: 12/27/02
- Next message: Jody Cleveland: "[PHP-DB] What is a "wrong parameter count" error mean?"
- Previous message: Ehab El Maraghy: "[PHP-DB] a newbie in deep need for help"
- In reply to: Ehab El Maraghy: "[PHP-DB] A newbie in deep need for help"
- Next in thread: Ehab El Maraghy: "Re: [PHP-DB] A newbie in deep need for help"
- Reply: Ehab El Maraghy: "Re: [PHP-DB] A newbie in deep need for help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nope. Use this statement:
$result = mysql_query($query2);
The mysql_query() function actually performs the query to the db for you and
returns a "resource" with your result set contained within.
The mysql_result() function extracts the contents of a given cell from your
result set; it does not actually execute the query to the db. Essentially
you use mysql_result() to operate on a result set. Other things you can use
on your result set include, but are not limited to: mysql_fetch_array(),
mysql_fetch_row() and mysql_fetch_object, but again, they are operating on
the result set retrieved by the mysql_query() function.
Here's a good overview of the above functions:
http://www.php.net/manual/en/function.mysql-result.php
Hope this helps
-----Original Message-----
From: Ehab El Maraghy [mailto:e_elmaraghy <email protected>]
Sent: Friday, December 27, 2002 4:17 AM
To: php-db <email protected>
Subject: [PHP-DB] A newbie in deep need for help
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
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Jody Cleveland: "[PHP-DB] What is a "wrong parameter count" error mean?"
- Previous message: Ehab El Maraghy: "[PHP-DB] a newbie in deep need for help"
- In reply to: Ehab El Maraghy: "[PHP-DB] A newbie in deep need for help"
- Next in thread: Ehab El Maraghy: "Re: [PHP-DB] A newbie in deep need for help"
- Reply: Ehab El Maraghy: "Re: [PHP-DB] A newbie in deep need for help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

