|
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 ' </td>'; // the is important for //
Navigation:
[Reply to this message]
|