Assume the following code:
[code=php]
<?php
$username=”david”;
$password=”passwd123″;
$database=”dbase1″;
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database”);
$query = “SELECT * FROM contacts”;
$result=mysql_query($query);
mysql_close();
?>
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:
echo $result[first][0];
(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?
Thanks.