image_address和名稱插入我用這個代碼在mysql中插入數據,而是直接顯示錯誤 「無法輸入數據:」 ......誤差在MySQL的
其他
{
$image=$_FILES['img']['name'];
$tmp_name=$_FILES['img']['tmp_name'];
$path= "/var/www/html/uploads/".$image;
if(move_uploaded_file($name,$path))
{
$sql = "INSERT INTO form1 ". "(fname,lname,username,password,age,email,branch,college,
gender,image_p,) ". "VALUES('$fname','$lname','$username','$password','$age','$mail','$branch','$college','$gender','$image')";
$retval = mysql_query($sql, $conn);
}
if(! $retval)
{
die('Could not enter data: ' . mysql_error());
}
else
{
echo "Entered data successfully\n"."\n ";
echo "you are now a registered user.";
mysql_close($conn);
}
迴應您的查詢,並確保這是正確的。 – 2016-01-06 12:18:16
從'gender,image_p'中刪除最後'''' – Saty
錯誤仍然相同 –