Ok, I have removed if(isset($row['attrib_value'])) and replaced it with the code below. The SQL query is confirmed and working.
When executing the code I get the following result as in the screenshot. It is one step closer to the truth...:-)
What I although need is a table that looks like the one below the checked checkboxes, the one with sizes from 30-47 AND pre-checked checkboxes for values as the top table 41-46 in the same table.
I need to display all the 17 checkboxes (size 30-47) and then check the checkboxes applicable for this specific product...
I can not for my life figure out a SQL-statement for that...
I alltered your code a bit to
Code:
if($roweusize['attrib_value'] == "")
How should I do this...?
current status:

Code:
<?
$resulteusize = mysql_query
("SELECT
attribute_values.value_id,
attribute_values.attrib_value
FROM
attribute_values,
product_attributes
WHERE
username='$session->username' and
attribute_values.value_id = product_attributes.value_id and
product_attributes.productid = ".$produpd." and
attribute_values.attrib_id = 1 and
attribute_values.attrib_value BETWEEN 30 and 46
ORDER BY
attribute_values.attrib_value")
or die(mysql_error());
echo "<table border='1' bordercolor='#cccccc' cellspacing='0' cellpadding='1'>";
echo "<tr bgcolor='#cccccc'>
<td colspan=\"2\" align=\"center\">EU Size</td>";
while($roweusize = mysql_fetch_assoc($resulteusize)) {
if($roweusize['attrib_value'] == ""){
echo "<tr><td>";
echo "<input type=\"checkbox\" name=\"size[]\" value=" .$roweusize[value_id]. ">";
echo "</td>";
echo "<td>";
echo $roweusize['attrib_value'];
echo "</td></tr>";
}
echo "<tr><td>";
echo "<input type=\"checkbox\" name=\"size[]\" value=" .$roweusize[value_id]. " checked>";
echo "</td>";
echo "<td>";
echo $roweusize['attrib_value'];
echo "</td></tr>";
}
?>
Thanks in advance...
/Johan
Bookmarks