$result = mysql_query... What is '$result'? An array?
Assume the following code:
What type of variable is $result? I assumed it was a multi-dimensional array, but why can't I echo one of its values to the browser by using:
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM contacts";
(There is a field in the table called 'first').
Does the function mysql_query() create some sort of special data type that can only be used by other, pre-defined functions?
Last edited by callumd; 08-23-2006 at 10:53 PM.
Yes, it returns a "resource ID" which can then be used by any of the mysql_fetch_*() functions, and other functions such as mysql_data_seek() and mysql_num_rows().
Originally Posted by callumd
Lightning quick answer, much appreciated.
No problem. See http://www.php.net/manual/en/functio...etch-assoc.php for a typical example of using a mysql_query() result.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)