<?php
include("config.php");
$From=$_POST['Kname'];
$User=$_POST ['Qtime'];
$Skind=$_POST['Ytime'];
$Belong=$_POST['Xname'];
if($From!=""){
$sql="INSERT INTO server(id,From,User,Skind,Belong ) VALUES ('','$From','$User','$Skind','$Belong')";
if(mysql_query($sql)){
echo"<script>alert('Added successfully!'); javascript:window.location.href=document.referrer;</script>";
}
else{
echo "Upload failed!";
}
}else
{
echo "The data is empty";
}
?>
The above cannot be solved by adding data to the database
无忌哥哥2018-06-20 14:07:28
First check to see if the form value has been passed. If so, print the SQL statement to see if there are any syntax errors.