I am seeing the echo of an entire row of a query:
echo "<ul>";
while($row = mysql_fetch_row($result))
{
echo "<li>{$row[0]}</li>";
}
echo "</ul>";
When the query is processed there is only one column (client_id) displayed from the database instead of the entire row. However, when I use
print_r(mysql_fetch_assoc($result));
just before while loop I can see displayed:
Array (
[client_id] => 1
[contact_first_name] => carla
[contact_last_name] => clausen
[business_name] => Banana Belt Liquors
[business_address] => 300 U.S. 24 Woodlan
[business_address2] =>
[business_city] => Woodland Park
[business_state] => Colorado
[business_zip] => 80863
[business_areaCode_phone] => 719
[business_phone] => 687
[business_phone2] => 9757
[business_url] => http://bananabeltliquors.com/
[business_email] => [email protected]
)
echo "<li>{$row[0]}</li>"is only echoing the first element of each row. That's why you don't see any more.echo "<li>{$row['contact_first_name']}</li>";instead. And don't mix fetch_row and fetch_assoc. pick one style and go with it. Or use fetch_array, and get both.