Jump to content


Photo

new row after 3 results


  • Please log in to reply
3 replies to this topic

#1 Woodburn2006

Woodburn2006
  • Members
  • PipPipPip
  • Advanced Member
  • 214 posts

Posted 05 August 2006 - 06:32 PM

i am getting results from a database and i want there to be 3 results on each row, so that when 3 results have been displayed it creates a new line and displays the next 3 results there. i have tried but cannot seem to do it. this is the code that i tried with:

<table width='150' border='0' cellspacing='2' cellpadding='0'><tr>
	  <?
$cell_count = 0;
while ($row = mysql_fetch_array($result)) {
	
if ($cell_count % 2){
	extract($row);
	$price = "£$price";
	echo  "</tr><tr>";
	$cell_count++;
}else{echo  "

    <td><div align='center'><img name='' src='' width='150' height='150' alt='' style='background-color: #CCCCCC'></td>

";
$cell_count++;
}

}
?>
	  
  </tr></table>

anyone know how i can solve this?

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 August 2006 - 06:51 PM

http://www.php-mysql...ysql-paging.php

use this linl an see the example how to inplement the pagginton
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Woodburn2006

Woodburn2006
  • Members
  • PipPipPip
  • Advanced Member
  • 214 posts

Posted 05 August 2006 - 06:57 PM

ok thanks, but i fail to see how i can use it.

i want 3 images on each row.

thanks

#4 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 05 August 2006 - 07:10 PM

We have had this topic twice over the last 2 days.

See threads http://www.phpfreaks...c,102715.0.html and http://www.phpfreaks...c,103051.0.html
RTFM is an almost extinct art form, it should be subsidized.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users