为什么我收到错误消息?
<?php
$output ="";
$query = "HELP;";
$output = mysql_query($query, $emailTrackerConnection) or die(mysql_error());
echo "<pre>$output</pre>";
?>
我收到的输出:
您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在第1行的''附近使用正确的语法
答案 0 :(得分:3)
HELP;
(不带参数)是MySQL命令行工具的内部命令,而不是SQL命令:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1862
Server version: 5.1.39-community MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
但是,如果您添加搜索字符串,则会获得SQL command:
帮助'search_string'
答案 1 :(得分:1)
答案 2 :(得分:1)
HELP ;
将返回此错误。尝试使用HELP 'statement or keyword or operator' ;
获取特定关键字的帮助。
如果您想查找哪些关键字/运算符/语句可用于HELP
,请使用以下命令:
HELP '%' ;