Hi all,
I am trying to implement Weedpackets pagination solution I found here with my code. He is using a mysql_result with straight <td> </td> tags, and I have somewhat more complicated tags with an if statement enclosed in a input tag, making is near impossible for me to get his solution to work for me.
In his example, he used this;
//The usual "Let's push elements onto an array" deal.
$all_columns[$current_column][]=mysql_result($result,$i,'ShortName');
for($i=0; $i<$display_rows-$padding; $i++)
{ echo '<tr>';
for($j=0; $j<$display_columns; $j++)
{ echo '<td>',$all_columns[$j][$i],'</td>';
}
echo '</tr>';
}
And the part I am stuck on is my equivalent of the <TD> tags are...
<td width="196" align=left style="padding-left:40px" nowrap="nowrap">
<input name="Products[1]" id="dy_rating_chk_1" type="checkbox" tabindex="29" value="1" <?php if(isset($_SESSION['products'][1])) { echo ' checked'; } ?>>
The Great Depression</td>
And my attempt to mix my code with his $display_columns was a feeble disaster.
here...
for($i=0; $i<$display_rows-$padding; $i++)
{ echo '<tr>';
for($j=0; $j<$display_columns; $j++)
{ echo '<td width="196" align=left style="padding-left:40px" nowrap="nowrap"><input name="Products['.$i.']" id="dy_rating_chk_'.$i.'" type="checkbox" tabindex="29" value="'.$i.'"';
if(isset($_SESSION['products'][$i])) { echo ' checked'; }
echo $all_columns[$j][$i].'</td>';
}
echo '</tr>';
}
Which should have gave me 3 colums, 11 items all with names and check boxes.
What I got 3 columns, 6 check boxes in the top 2 row with no names, and 4 names in the bottom 2 rows with no check boxes.
As always, I appreciate the guidance, and help.
Regards,
Don