PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
You should also check if there are actually data inside the table and depending on that result either echo the data or a message indicating 0 rows in the table.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
//get events from db
$results = mysql_query("SELECT * FROM events");
while ($mysql = mysql_fetch_array($results))
{
echo "ID: ".$mysql["id"]." and the event is ".$mysql["event"]." <br />";
}
I kept looking at this last night and it was not coming to me, but I knew I had done it hundreds of times before!