ketanco
08-06-2009, 06:06 PM
Hello,
I have a mysql table that has a few columns... One column is the "id", which is auto increment and primary key, another is called "category", and another is called paragraph1.
I would like to do two things:
1) Display the value of category column, that is in the row which has id of 2nd to latest (no matter what other columns are). Also use the value of category column as a link such as <a href="value.php">value</a>
2) Also, separately, I would like to display the paragraph1 values of two more rows. Those rows need to have a category value of, say, "aaa", AND they need to be the latest two entries (for that category aaa) so they need to have biggest and second to biggest id (again for that category aaa)
I know roughly what to do, but just dont know the exact syntax and quotations etc....Please help....
I have a mysql table that has a few columns... One column is the "id", which is auto increment and primary key, another is called "category", and another is called paragraph1.
I would like to do two things:
1) Display the value of category column, that is in the row which has id of 2nd to latest (no matter what other columns are). Also use the value of category column as a link such as <a href="value.php">value</a>
2) Also, separately, I would like to display the paragraph1 values of two more rows. Those rows need to have a category value of, say, "aaa", AND they need to be the latest two entries (for that category aaa) so they need to have biggest and second to biggest id (again for that category aaa)
I know roughly what to do, but just dont know the exact syntax and quotations etc....Please help....