我正在使用echo $fss
其显示数据
“ 11-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V5703211-V57032”
但是我正在使用使用此变量的删除查询,但它不起作用
<?php
//connect to the database
$connect = mysql_connect("localhost","root","");
mysql_select_db("cityshoes",$connect); //select the table
if ($_FILES[csv][size] > 0) {
//get the csv file
$file = $_FILES['csv']['tmp_name'];
$handle = fopen($file,"r");
do {
if ($data[0]) {
$fss = addslashes($data[1]);
$result = mysql_query("DELETE from contacts where articleno = . $fss . ");
echo $fss;
}
} while ($data = fgetcsv($handle,1000,",","'"));
}
?>
最佳答案
您以错误的方式在查询中附加变量。尝试:
$result = mysql_query("DELETE from contacts where articleno = $fss");
要么
$result = mysql_query("DELETE from contacts where articleno ='".$fss ."'");