You are here: Re: Best Practice for layout items at one page « PHP Programming Language « IT news, forums, messages
Re: Best Practice for layout items at one page

Posted by davihigh on 12/22/06 14:42

Great! That's really what i am looking for and it actually works!

But not enough :-) If i am understand correctly, this is some PHP code
which bind in HTML, if the HTML will be change, the PHP code also need
to be change to output HTML.
So, is there a neat way to write in using 'template'? Let me write some
pesduocode to explain what i am looking for:
<TR php:if (count%4==0)>
<TD php:if (result[count])>
<A href=php:(result[count]["field_image1_url"])></A>




"Cliff Smith wrote:
> Don't know if it would be "best practice", but this would work-
>
> $result = mysql_query ("SELECT * FROM item", $connection);
> $num_results = mysql_num_rows($result);
> $num_rows = ceil($num_results/4);
>
> for( $row=0; $row<$num_rows; $row++ ){
> echo '<tr>';
> for( $col=0; $col<4; $col++ ) {
> $data = @mysql_fetch_assoc($result);
> echo '<td>';
> .....
> do some stuff with the data
> .....
> echo '&nbsp;</td>'; // the &nbsp; is important for //

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация