RE: <SELECT> MULTIPLE ARRAY TABLES
Posted: Wed Jun 18, 2008 7:56 am
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>';
}
}
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>';
}
}