(feel free to point)
I have got a database setup as such
(I'm simplifying the structure a little)
table1.userid, table1.name
table2.userid, table2.phonetype, table2.phonenumber
table3.userid, table2.addresstype, table3.address
I have a form that users can use to edit there data.
It pulls up data from each table and populates a form.
What I want to know is how do I let users edit multiple rows in a table at once. Say for instance they have a work and home address they want to update, how could they do this.
I have setup the form (using just the phone as example:
Code: Select all
$result3= mysql_query("SELECT IDNumber AS r3IDNumber, Type, Prefix, Number, Extension FROM Phones $where ORDER BY type",$db) or die("Query failed : " . mysql_error());
if ($myrow3 = mysql_fetch_array($result3))
{
echo "<table>";
echo "<tr><td>Type</td><td>Prefix</td><td>Number</td><td>Extension</td><td>Delete</td></tr>\n";
do
{
$phonecount=$phonecount+1;
echo "<tr><td><input type=text name=phonetype$phonecount value='".$myrow3["Type"]."' size=3></td>";
echo "<td><input type=text name=phoneprefix$phonecount value='".$myrow3["Prefix"]."' size=3></td>";
echo "<td><input type=text name=phonenumber$phonecount value='".$myrow3["Number"]."' size=8></td>";
echo "<td><input type=text name=phoneext$phonecount value='".$myrow3['Extension']."' size=4></td>";
echo "<td><input type=checkbox name=daddr value=daddr></td></tr>";
} while ($myrow3 = mysql_fetch_array($result3));
echo "</table>";I figure a loop but not sure what to name the variables in the sql.
thanks
ColmTourque