Kacey,
here is some code I used for a project last year. The table is LANGUAGES and the LANUGAGES.ABREVIATION is used for the main array. VERSIONS is a colon-delimited area with numeric version numbers. I used this to build the 2nd dimension of the main array. Instead of that, you'd have a multidimensional javascript array similar to... myarray=["ID"]["INV_NAME"]["QUANTITY"]["DESCRIPTION"] .
<SCRIPT LANGUAGE="JavaScript">
var WfVersionLists = new Array;
<?
$connection=mysql_connect("localhost","root","") or die ("couldn't connect");
$db=@mysql_select_db($myDB, $connection) or die ("couldn't select database");
$SQL="select * from LANGUAGES order by FULL_TEXT asc";
$result=mysql_query ($SQL, $connection) or die ("couldn't execute query<br>sql stmnt=$SQL");
while ($row=mysql_fetch_array($result)){
?>
WfVersionLists["<?echo $row['ABBREVIATION']?>"] = new Array;
<?
$subarray=explode(":", $row['VERSIONS']);
for ($g=0;$g< count($subarray);$g++){?>
WfVersionLists["<?echo $row['ABBREVIATION']?>"]["<?echo $g?>"]="<?echo $subarray[$g]?>";
<?}
}//end while
?>
function setCats(x){
document.lang.WfVersionList.options.length=0;
for(g=0;g<WfVersionLists[x].length;g++){
document.lang.WfVersionList.options[g] = new Option(WfVersionLists[x][g]);
if (document.lang.WfVersionList.options.length==WfVersionLists[x].length){
if (x!=14){document.lang.WfVersionList.options[document.lang.WfVersionList.options.length]= new Option ("------------------");}
}
}
}
function setCats2(){
if (document.lang.WfVersionList.options[document.lang.WfVersionList.selectedIndex].text!="----"){
document.lang.currLangAbbrev.value=document.lang.currLangList.options[document.lang.currLangList.selectedIndex].text + " -> " + document.lang.WfVersionList.options[document.lang.WfVersionList.selectedIndex].text;
}
}
</script>
<form name="lang" action="<? echo $PHP_SELF;?>" onSubmit="return doIt()">
<table width=400 border=0 bgcolor=black cellpadding="1" cellspacing=0>
<td>
<table width=100% border=0 bgcolor=#e6e6e6 cellpadding="4" cellspacing=0>
<tr><td>Please select from the list:</td><td> </td><tr>
<td><select size=5 name="currLangList" onChange="setCats(currLangAbbrev.value);">
<option value="0" default></option>
<?
$connection=mysql_connect("localhost","root","") or die ("couldn't connect");
$db=@mysql_select_db($myDB, $connection) or die ("couldn't select database");//retreive it
$SQL="select * from LANGUAGES order by FULL_TEXT asc";
$result=mysql_query ($SQL, $connection) or die ("couldn't execute query<br>sql stmnt=$SQL");
while ($row=mysql_fetch_array($result)){
?>
<option value="<?echo $row['ABBREVIATION']?>"><?echo $row['FULL_TEXT']?></option>
<?}
mysql_close($connection);
?>
</select> :Language</td>
<td><select size=5 name="WfVersionList">
<option value="0" selected>------------------</option>
</select> :Wf Version</td>
</table></table>
<p> </p>
<input type=submit value="Next Step" class="orange"></form>
Hope that all came through OK. Anymore questions, let me know.