Noob's ignorance: Just basic php code question
Posted: Mon Aug 14, 2006 2:47 pm
In an attempt to learn mysql database and flash integration, I've started putting together a little flash app that reads and submits a "blog" entry.
Right now it does two things, 1 it reads the fields "title" and "content" in the db table blogTable. So far i only have 2 rows of data, my first entry (0), and the latest entry (1).
What i would like to know is how to display the latest entry in the table instead of the first (0).
I know that below in the code, if i replaced 0 with 1, it would show the latest entry, but of course that's not what i should have because once i submit a new entry in the table, the latest row would be 2.
So basically i need to figure out how to make this list the latest entry in the table.
Any of your guys' help on this is so much appreciated.
Thanks!
Right now it does two things, 1 it reads the fields "title" and "content" in the db table blogTable. So far i only have 2 rows of data, my first entry (0), and the latest entry (1).
What i would like to know is how to display the latest entry in the table instead of the first (0).
I know that below in the code, if i replaced 0 with 1, it would show the latest entry, but of course that's not what i should have because once i submit a new entry in the table, the latest row would be 2.
Code: Select all
$query = "SELECT * FROM blogTable";
$result = mysql_query($query);
$title = mysql_result($result,0,"title");
$content = mysql_result($result,0,"content");Any of your guys' help on this is so much appreciated.
Thanks!