我收到语法错误,但对我而言似乎是正确的代码,但得到了:
解析错误:语法错误,意外';'在第121行的C:\ xampp \ htdocs \ orlando \ php \ processor \ processor.php
我的代码是:
$sql_new = mysqli_query($conn,
'SELECT * FROM
products_added
where username = "'.mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR'].'"
ORDER BY id asc'
);
答案 0 :(得分:3)
您在mysqli_real_escape_string
上留下了右括号。
$sql_new = mysqli_query($conn,
'SELECT * FROM
products_added
where username = "' .mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR']) . '"
ORDER BY id asc'
);
答案 1 :(得分:1)
在此行中缺少)
:
where username = "'.mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR'].'"
应该是:
where username = "'.mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR']).'"
答案 2 :(得分:0)
您在查询
中错过了最后)
'SELECT * FROM products_added
where username = "'.mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR']).'"
ORDER BY id asc'
答案 3 :(得分:0)
$sql_new = mysqli_query($conn,
'SELECT * FROM
products_added
where username = "'.mysqli_real_escape_string($conn, $_SERVER['REMOTE_ADDR']**)**.'"
ORDER BY id asc'
);
添加此支架,此处以粗体显示..