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: <SELECT> MULTIPLE ARRAY TABLES
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: RE: <SELECT> MULTIPLE ARRAY TABLES
I highly recommend having a look at this page for a minimal of ten seconds...
http://forums.devnetwork.net/
http://forums.devnetwork.net/