note 4715 deleted from mysql_result by danbeck
| From: | danbeck@php.net | Date: | Thu, 07 Sep 2000 18:22:01 +0000 |
| Subject: | note 4715 deleted from mysql_result by danbeck | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4431@lists.php.net to get a copy of this message | ||
you can say:<br>
<b>$result=mysql_query("SELECT * FROM tablename;",$db);</b>
<br>
with $db being a database already connected with mysql_connect and that you selected with
mysql_select_db<br>
then:<br>
<b>
printf("First Name: %s", mysql_result($result,1,"fname"));</b>
<br>
here, the dataspace (column) 'fname' is selected for row number 1 of the output you
grabbed in $result.
<br><br>So in short, mysql_result takes your result from your query as its first
parameter.<br>
learn more at <b>www.devshed.com</b>
or at <b>www.webmonkey.com</b>.
<br><br>
-Ben Wheeler