hi.
i've got a checkbox list that gets populated by previous selections.
the problem is, if no options were selected previously, i'm getting an "offset 0 is invalid for mysql result index error"
i'm checking to see if the sql array has data, yet i'm still getting an error?
suggestions?
code sample:
//this is the second query
$query2="Select $dd2 from ".$dd."list where property_id=$id";
$results2 = mysql_query($query2);
//this is going through the first array
while($values = mysql_fetch_array($results)){
//checks to see if results2 is valid
//this is where it's giving the error
if ($results2) {
while($values2 = mysql_fetch_array($results2)){
if ($values2[$dd2] == $values[ID]) {
$checked = "checked";
}
}
mysql_data_seek($results2,0);
}
echo "<input type='checkbox' name='".$dd2."[]' value=\"$values[ID]\" ".$checked.">$values[Name]<br />";
$checked = "";
};