Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php/mysql_Php_Mysql - Fatal编程技术网

php/mysql

php/mysql,php,mysql,Php,Mysql,有人能帮我查询格式吗。我的输出是: UPDATE TABLE SET Notes = 'testyyy', 0 WHERE Id = '1' …应在何时: UPDATE TABLE SET Notes = 'testyyy , Notify = '0' WHERE Id = '1' PHP: 将)移动到“1”的另一侧: $up .= " Notify = '".($data["Notes"] == '' ? '0' : '1')."'";

有人能帮我查询格式吗。我的输出是:

UPDATE TABLE 
   SET Notes = 'testyyy',
       0 
 WHERE Id = '1'
…应在何时:

UPDATE TABLE 
   SET Notes = 'testyyy , 
       Notify = '0' 
 WHERE Id = '1'
PHP:

将)移动到“1”的另一侧:

$up .= " Notify = '".($data["Notes"] == '' ? '0' : '1')."'";
尝试使用:

$up .= " Notify = '".($data["Notes"] == '' ? '0' : '1')."'";
或者,您也可以将其分为两部分:

$up .= " Notify = '";
$up .= ($data["Notes"] == '') ? '0' : '1'."'";
另外,
TABLE
是一个MySQL保留字,您需要将它放在后面的勾号中

$up = "UPDATE TABLE SET Notes = '".$_POST["field"]."' ",";
看起来不对

$up = "UPDATE TABLE SET Notes = '".$_POST["field"]."' ,";
并确保转义$\u POST值

$up = "UPDATE TABLE SET Notes = '".$_POST["field"]."' ,";