phpjay Posted July 12, 2011 Share Posted July 12, 2011 i need help for update and insert where table1.id = table2.id <?php include ('connection.php'); $con = mysql_connect("$host","$username","$password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$db", $con); $acft = $_POST['acft']; $DateIssued = $_POST['DateIssued']; $IssuedTo = $_POST['IssuedTo']; $ID = $_POST['ID']; #$remarks = $_POST['remarks']; $TimeOut = $_POST['TimeOut']; $sql="UPDATE $table2 SET acft='$acft', DateIssued='$DateIssued', IssuedTo='$IssuedTo', TimeOut = '$TimeOut' where ID='$ID'"; mysql_select_db("$db", $con); if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } Link to comment https://forums.phpfreaks.com/topic/241775-update-and-insert/ Share on other sites More sharing options...
fenway Posted July 14, 2011 Share Posted July 14, 2011 Double-post. Link to comment https://forums.phpfreaks.com/topic/241775-update-and-insert/#findComment-1242501 Share on other sites More sharing options...
Recommended Posts