Hi!
Does anyone knows how to do this
I have a list of results from "table 2" that are listed if the "ID2" from this table is the same as "ID" from "table 1"
Ok
In this list, there are form fields for each record and "one update button" for all the registers, so I can update them all with one click.
The thing is that is not working and not updating anything
I will post my code and if anybody can tell me what I´m doing wrong I will appreciate it big time
list.php -->
$ResultT = mysql_db_query ("$Db","SELECT from table1 WHERE ID='$ID' ");
$Resulta = mysql_db_query ("$Db","SELECT from table2 WHERE ID2='$ID1' ");
// this comes from table 1
<?
while ($ResultT = mysql_fetch_array($ResultsT)){
$ID = $ResultT["ID"];
?>
// this comes from table 2
<?
while ($Resulta = mysql_fetch_array($Results2)){
$ID2 = $Resulta["ID2"];
$Name = $Resulta["Name"];
?>
<form method="post" action="update.php?&ID2=<? echo "$ID2"; ?>">
<input name="name" type="text" id="name" value="<? echo "$name"; ?>">
<input name="Submit" type="submit" value="Update">
update.php -->
$update=mysql_query("UPDATE table2
SET name='$name"
WHERE ID='$ID'");
?>
//where ID is the primary key in this table2
I'm pretty confused right now, hehe, hope somebody can tell me where I´m wrong
ThankU