I am trying to take some information from a table, and place the information into an array (so I can easily access elements in the table, without having to do a query everytime). However, when I perform the query and try to place the elements into an array, the first row of my table is skipped.
Here is the code:
// Get COLOR information
$colorhtml = array();
$colorname = array();
$thaquery = "SELECT * FROM color";
$total_result = mysql_query($thaquery,$db);
if (mysql_fetch_array($total_result))
{
while ($listinfo = mysql_fetch_array($total_result))
{
$thecolorid = $listinfo["colorid"];
// enter color html
$colorhtml["$thecolorid"]=$listinfo["colorhtml"];
// enter color name
$colorname["$thecolorid"]=$listinfo["colorname"];
// Test element
echo $colorname["$thecolorid"].": ".$colorhtml["$thecolorid"]." ";
}
}
?>