Is there a way to move to the next record where stated in the PHP code?
Thanks, ILMVPHP Code:while ($myrow = mysql_fetch_row($result)) {
echo("line 1");
// Move to next record
echo("line 2");
}
Printable View
Is there a way to move to the next record where stated in the PHP code?
Thanks, ILMVPHP Code:while ($myrow = mysql_fetch_row($result)) {
echo("line 1");
// Move to next record
echo("line 2");
}
When you call mysql_fetch_row it autmatcially moves to the next record. Are you trying to do something specific.
Yes i am loading pictures using a link in a MySQL database, the pictures are two to a row, so i need to bring the first down, then move a record and bring the second donwn.
If there isnt a way around it i will have to do it the hard way.
thanks :thup:
Your putting the images in a table right?
Try
PHP Code:<table>
<tr>
<?
$i = 1;
while ($myrow = mysql_fetch_row($result))
{
print "<td>{$myrow['value']}</td>"
if(($i % 2)==0)
{
print "</tr><tr>";
}
$i++
}
?>
</tr>
</table>
That was plan B ;)
Thanks for your help (Y)