I'm trying to modify a bit of php I've found, but either because it's the early hours of the morning here or I'm stupid, but I just can't get it to work - None of the examples I've found on the internet work for me either.
Basically the code I want to modify has the line
Code: Select all
$items = array(
"Car"=>"Red",
"Bike"=>"Blue");
Code: Select all
$result = mysql_query ("SELECT item, color FROM things");
$items = array();
while ($row = mysql_fetch_assoc($result)) {
$items[] = $row;
}
Can anybody help a tired amateur?
Many thanks
Chris