Jump to content

update and insert


phpjay

Recommended Posts

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
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.