I am trying to create a page that updates info into two tables in the same database.
How do I do this pls?
I am getting a parse error at present, here is a copy of the script.
[insert.php]
<html>
<body>
<?
mysql_connect('localhost','root');
@mysql_select_db('reseller')or die("Unable to connect to database");
$company=$POST['company'];
$address=$POST['address'];
$address2=$POST['address2'];
$county=$POST['county'];
$postcode=$POST['postcode'];
$tel=$POST['tel'];
$fax=$POST['fax'];
$web=$POST['web']
//info to go into seperate table - contact
$first=$POST['first'];
$surname=$POST['surname'];
$position=$POST['position'];
$phone=$POST['phone'];
$email=$_POST['email'];
mysql_connect('localhost','root');
@mysql_select_db('reseller')or die("Unable to connect to database");
$query="INSERT INTO company VALUES('$company','$address','$address2','$county','$postcode',
'$tel','$fax','$web')";
mysql_query($query);
$query1="INSERT INTO contact VALUES('$first','$surname','$position','$phone','$email')";
mysql_query($query1);
$query="SELECT * FROM company";
$result=mysql_query($query);
$num=mysql_numrows($result);
$query1="SELECT * FROM contact";
$result1=mysql_query($query1);
$num1=mysql_numrows($result1);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while($i<$num){
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");
$mobile=mysql_result($result,$i,"mobile");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$web=mysql_result($result,$i,"web");
echo "<b>$first $last</b><br>Phone:$phone<br>Mobile:$mobile<br>Fax:$fax<br>E-mail:$email
<br>Web:$web<br><hr><br>";
++$i;
}
?>
</body>
</html>