[thelist] PHP Logic help

M. Seyon evoltlist at delime.com
Fri Jan 21 22:11:00 CST 2005


Message from Chris Ditty (1/21/2005 12:50 AM)
>Hi all.  I am having some logic issues that I just can't get tonight.
>Hopefully someone can help.

Hi Chris,

I'm not sure if you got your problem solved yet. Even after your follow-up 
post I don't quite understand what you want your final html to look like. 
Perhaps if you can post a couple lines of what you want it'll be easier to 
understand.

For example, are you trying to output:

<table>
<tr>
<td>ProductName1</td>
<td>ProductImage1</td>
<td>ProductName2</td>
<td>ProductImage2</td>
<td>ProductName3</td>
<td>ProductImage3</td>
</tr>
<tr>
<td>ProductName4</td>
<td>ProductImage4</td>
<td>ProductName5</td>
<td>ProductImage5</td>
<td>ProductName6</td>
<td>ProductImage6</td>
</tr>
</table>

?

Or am I way off base?



>foreach($categoryInfo as $products){
>?>
>         <div class="content padding">
>         <table border="0" cellspacing="0" cellpadding="0" width="100%">
>         [SNIP]
>         </table>
>         </div>
><?
>}
>?>

This creates a separate table for each product, not so?

<tip type="writing code to generate html">
When writing code to auto-generate html I find it's helpful to include a 
commented-out version of the intended output above the code. Makes it 
easier to compare what the code is doing to what you want it to do. And, of 
course, six months down the line, easier to remember what you were doing in 
the first place.
</tip>

regards.
-marc

--
Trinidad Carnival in all its photographic glory. Playyuhself.com
http://www.playyuhself.com/


More information about the thelist mailing list