Hi,
I am doing a simple query on a mysql database called min_add.txt with the following code:
<body>
<?php $db = mysql_connect("localhost", "minserv", "miner99");
mysql_select_db("min_add.txt",$db);
$sql_query = mysql_query("SELECT * FROM Minerals",$db);
$eresult = mysql_query($sql_query);
while($row = mysql_fetch_array($eresult))
{
echo $row[Mineral_Name];
echo $row[Formula];
}
?>
</body>
I want to display all results from the minerals table. I keep on getting this error:
Warning: 0 is not a MySQL result index on line 7
The culprit is this line
while($row = mysql_fetch_array($eresult))
but I can't find anything wrong. Any suggestions?