Ok, first post so thanks in advance for any help.
So, the situation is this:
When I use mysql_fetch_array (with or without 2nd parameter) on the result set, I get nothing. When using mysql_fetch_row I get my data BUT I feel like the other should work and I should be able to reference the fild name as the array index. Below is the code and here is the URL of this particular page (http://www.talaria.biz/DBTEST.php).
Again, thanks for your help!
<?
$dbConn = mysql_connect ("localhost", "myuser", "mypass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("mydb");
$sqlText = "SELECT * FROM test";
$records = mysql_query($sqlText) or die("Query failed : " . mysql_error());
$x=0;
/* This DOES return a Resource id of 2 */
if($records)
{
print "Returned: " . $records . "<BR>";
}
else
{
print "It was empty<BR>";
}
/* This DOES work but I want to be able to reference by field name */
while($record = mysql_fetch_row($records))
{
print $record[0] . "<BR>";
}
/* This does NOT work.
while($record = mysql_fetch_array($records, MYSQL_NUM));
{
$x++;
print $x . " = " . $record[0];
}
*/
mysql_free_result($records);
?>