Page 1 of 1

RE: <SELECT> MULTIPLE ARRAY TABLES

Posted: Wed Jun 18, 2008 7:56 am
by ton50pac
Hi!

Im having trouble creating different <select> per table with their own individual EDIT and ADD button
I manage to create the <SELECT> and put the right data on each <SELECT> but the problem is whenever
i click on the edit the last <SELECT> that has data or value on it appears..with different EDIT buttons same output comes out
please help..tnx

ton

$sqlmastertable = "SELECT mastertablename FROM companymastertable ORDER BY mastertablename";
$resultmastertable = mysql_query($sqlmastertable);
$xrow = mysql_num_rows($resultmastertable);

while($row = mysql_fetch_assoc($resultmastertable)) {
foreach($row as $col => $valmastertable) {
$buttoneditmaster = $valmastertable;
$tablename = (explode("masterTable", $valmastertable));
echo '<tr>';
echo "<td>$tablename[0] Master</td>";

$sqlmastertlist = "SELECT id FROM $valmastertable";
$resultmasterlist = mysql_query($sqlmastertlist);
echo '<td><select id="$valmastertable" name="$valmastertable" STYLE="width: 125px">';

while($row = mysql_fetch_assoc($resultmasterlist)) {
foreach($row as $col => $valmasterlist) {

echo "<option value=$valmasterlist>$valmasterlist<br></option>";

}
}
echo "</select></td>";
echo "<td>Name of Select is $valmastertable</td>";
?>
<td><button type="button" id="addmaster" onclick="window.location.href='addmaster.php';">Add</button></td>
<? echo '<td><input type="Submit" value="Edit" name="$buttoneditmaster"></input></td>';
echo '</tr>';
}

}

Re: RE: <SELECT> MULTIPLE ARRAY TABLES

Posted: Wed Jun 18, 2008 10:49 am
by JAB Creations
I highly recommend having a look at this page for a minimal of ten seconds...
http://forums.devnetwork.net/