I am storing sizes from to a table called sizes in pipe delimitted fashion. Each value in the pipe represents a specific size and I want to get the pipe data, explode it, then show checked boxes in a form if the value and color match. If no match, then nada.
This was the code i was working on and I feel I am getting close, but, since I have to get this done like today. I am now asking for help.. The code is on the bottom.
Ray
from table -
sizes
26660|26661|26662
26658|26660|26661|26662|26663|26664|26673
-- script---
$sizes ="26658|26660|26661|26662|26663|26664|26673"
$size = explode("|", "$sizes");
for($k =0; $k < count($size); $k++) {
$qrystr = "select * from sizes";
$numresults= pg_exec($qrystr);
$numrows=pg_numrows($numresults);
$j=0;
for ($i =0; $i < $numrows; $i++, $j++) {
$id = pg_result($numresults,$i,0);
$size1 = pg_result($numresults,$i,1);
if ($j==0) {
echo "<tr>";
}
echo "$size[$k] = $id";
if ($size[$k] ==$id) {
// While ($size[$i] == $id) {
echo "<td nowrap valign=top width=\"75\" height=\"75\" valign=top><input type=checkbox value=$id name=size[] checked><font size=-1>$size1</font></td>";
//
// }
}else{
echo "<td nowrap width=\"75\" height=\"75\" valign=top><input type=checkbox value=$id name=size[] ><font size=-1>$size1</font></td>";
}
//echo "<td nowrap valign=top width=\"75\" height=\"75\" valign=top><input type=checkbox value=$id name=size[] checked><font size=-1>$size1</font></td>";
if ($j == 4 || $j == ($numrows - 1)){
echo "</tr>";
$j=0;
}
}
}