listing results?
Posted: Fri Apr 23, 2010 10:04 pm
I know this is a stupid question but how do I make this work like I want it to. I know I have done it before but for some reason I cant see it tonight.
What I want is to get the event_id and event name from the events table and list them as ID event. (only two things in the table)
This is what i have but is does not exactly work.
What I want is to get the event_id and event name from the events table and list them as ID event. (only two things in the table)
This is what i have but is does not exactly work.
Code: Select all
//get events from db
$results = mysql_query("SELECT * FROM events");
while ($mysql = mysql_fetch_array($results))
{
foreach( $mysql as $id => $event){
echo "ID: $id, Event: $event <br />";
}
}