it's ok to PM me with the access details, I didn't run it against a database, I just set the variable to test the logic of the code
it's ok to PM me with the access details, I didn't run it against a database, I just set the variable to test the logic of the code
PM sent let me know when you can
I found a few errors in your code for subcategory2, but this code worked for me.
Fit this into the right place in your code and give it a testPHP Code:} else {
if ($data=='subcategory2') {
echo "<select name='subcategory2' >\n";
echo "<option value='0'>======== Subcategory2 ========</option>\n";
$val2=$val;
$val = substr($val,0,4);
$result=mysql_db_query($dbname,"SELECT `subcat_id`, `subcat2` FROM subcategory2 WHERE `subcat_id` = '$val2' AND subcat_id LIKE '$val%' ORDER BY `subcat2` ");
while(list($subcat_id, $subcat2)=mysql_fetch_array($result)){
echo "<option value=\"$subcat_id\" >$subcat2</option> \n" ;
}
}
}
echo "</select>\n";
?>
I switched the code like you suggested and the third drop down menu is now working, however there is no correspondece yet between the selection made in the second drop down with the items displayed in the third...
I am trying to tweak the code you provided me to see if I can get it to work...
thanks because it is a great move forward towards the solution...
Right now I am looking at phpmyadmin for the DB to understand why the other records from subcategory2 are not showing at all...only certain initial records are displayed, indipendently from what selection is made in drop down menu #2
Bookmarks