我想在phpmyadmin的两个表中上传相同的数据。但这行不通。 请帮帮我。 但是在我第一次创建时,它可以正常工作,但是之后,它就不再工作了。
<?php
include_once("config.php");
if(isset($_POST['Submit'])) {
$name = $_POST['name'];
$pname = $_POST['pname'];
$adds = $_POST['adds'];
$occu = $_POST['occu'];
$qual = $_POST['qual'];
$ci = $_POST['ci'];
$phone = $_POST['phone'];
$phone = $_POST['phone2'];
$instn = $_POST['instn'];
$about = $_POST['about'];
$t1 = $_POST['t1'];
$t2 = $_POST['t2'];
$t3 = $_POST['t3'];
$fname = $_POST['fname'];
$otherd = $_POST['otherd'];
$date = $_POST['date'];
$bb = $_POST['bb'];
if(empty($name) ) {
if(empty($name)) {
echo "<font color='red'>Name field is empty.</font><br/>";
}
echo "<br/><a href='javascript:self.history.back();'>Go Back</a>";
} else {
$result = mysqli_query($mysqli, "INSERT INTO enqbagnan
(name,pname,adds,occu,qual,ci,phone,phone2,
instn,about,t1,t2,t3,fname,otherd,date,bb)
VALUES('$name','$pname','$adds','$occu',
'$qual','$ci','$phone','$phone2',
'$instn','$about','$t1','$t2',
'$t3','$fname','$otherd',
'$date','$bb')");
$result1 = mysqli_query($mysqli, "INSERT INTO formbagnan
(name) VALUES('$name')");
echo "<font color='green'>Data added successfully.";
}
}
?>