I have a php/mysql query that returns 4 rows and outputs the data inside a table.
I want insert something in the middle of it that does something along the lines of 'if the row = row1 then { do something } elseif the row = row 4 then { do something }'
I can't work out how it should be done, can anyone help?
$thumbs = mysql_query("SELECT id, category, path, client, img_url, role FROM portfolio ORDER BY id DESC");
if (!$thumbs) { echo 'Could not run query: ' . mysql_error(); exit; }
while($results = mysql_fetch_array($thumbs)) {
//display data
}
Question
game_over
I have a php/mysql query that returns 4 rows and outputs the data inside a table.
I want insert something in the middle of it that does something along the lines of 'if the row = row1 then { do something } elseif the row = row 4 then { do something }'
I can't work out how it should be done, can anyone help?
$thumbs = mysql_query("SELECT id, category, path, client, img_url, role FROM portfolio ORDER BY id DESC"); if (!$thumbs) { echo 'Could not run query: ' . mysql_error(); exit; } while($results = mysql_fetch_array($thumbs)) { //display data }Link to comment
Share on other sites
20 answers to this question
Recommended Posts