RE: <SELECT> MULTIPLE ARRAY TABLES

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
ton50pac
Forum Newbie
Posts: 1
Joined: Wed Jun 18, 2008 7:49 am

RE: <SELECT> MULTIPLE ARRAY TABLES

Post 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>';
}

}
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: RE: <SELECT> MULTIPLE ARRAY TABLES

Post by JAB Creations »

I highly recommend having a look at this page for a minimal of ten seconds...
http://forums.devnetwork.net/
Post Reply