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 have an SQL query with 3 records.
In this code, there are three rows to be displayed
echo $row['550img'];
echo $row['272img'];
echo $row['272img'];
What I need to happen is have it move to the next record for each of these.
So the 550img would be from record 1, the 272img from record 2, and the second 272img from record 3.
In asp I would use soemthing like recordset.movenext
$query="SELECT * FROM `products` WHERE `type` = 'television' ORDER BY id DESC LIMIT 3";
$result=mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo $row['column1'];
echo $row['column2'];
// Any other code you need
}
I was using a while loop in the beginning but what it gave me was 3 groupings of 3 images.
Basically each product has two image sizes a 550 and a 272. I want the script to pull the most recent 3 entries in the table and for the first entry, display its 550 image, the second will show its 272 image and the third will show its 272 image as well.
So I need:
write 550 image path
go to next record
write 272 image path
go to next record
write 272 image path