RE: [PHP-DB] New to PHP Need Help
| From: | Rick Emery | Date: | Thu, 04 Apr 2002 16:26:05 +0000 |
| Subject: | RE: [PHP-DB] New to PHP Need Help | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-18211@lists.php.net to get a copy of this message | ||
Jason,
If you don't have one, I would also recommend a good book that combines PHP
and MYSQL interaction. I would strongly suggest the one I cut my PHP teeth
on:
PHP Essentials by Julie Meloni
-----Original Message-----
From: Julie Meloni [mailto:julie@thickbook.com]
Sent: Thursday, April 04, 2002 10:18 AM
To: Jason Tobias
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] New to PHP Need Help
JT> $Location_Info = mysql_fetch_row($result);
JT> echo "<p>$Location_Info";
After you fetch the row, you have to extract the elements from the
array that makes up the row. For more than one row in your result, you have
to call
mysql_fetch_row() again.
From http://www.php.net/manual/en/function.mysql-fetch-row.php
:
mysql_fetch_row -- Get a result row as an enumerated array
Examples of using this function follow on the manual page.
I would venture to guess that what you really want to use would be
mysql_fetch_array(), which also produces an array of results, but
_all_ of the rows, not just the first one (and thus does not require
additional calls to the function).
From http://www.php.net/manual/en/function.mysql-fetch-array.php
:
mysql_fetch_array -- Fetch a result row as an associative array, a numeric
array, or both.
With examples also on the manual page.
- Julie
--> Julie Meloni
--> julie@thickbook.com
--> www.thickbook.com
Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php