gpt4 book ai didi

php - 我无法弄清楚语法错误

转载 作者:行者123 更新时间:2023-11-29 04:47:48 27 4
gpt4 key购买 nike

<分区>

为什么第 21 行出现语法错误? (在 if($sql) 行)我是新手,无法弄清楚。我一直在旋转我的轮子一个小时。我相信这对这里的大多数人来说非常简单。

 <?php 
$conn = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("solera_menu",$conn);

if(isset($_POST['submit']))
{
$file = $_FILES['file']['tmp_name'];

$handle = fopen($file,"r");
while(($fileop = fgetcsv($handle,1000,",")) !==false)
{
$order = $fileop[0];
$category = $fileop[1];
$name = $fileop[2];
$description = $fileop[3];
$price = $fileop[4];


$sql = mysql_query("INSERT INTO dinner (order,category,name,description,price) VALUES ('$order','$category','$name','$description','$price')")

if($sql)
{
echo 'Data Uploaded Successfully';
}
}

}

?>

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com