2013-01-02 181 views
0

为什么我收到此错误消息?命令导致SQL语法错误

<?php 
$output =""; 
$query = "HELP;"; 
$output = mysql_query($query, $emailTrackerConnection) or die(mysql_error()); 

echo "<pre>$output</pre>"; 
?> 

输出我得到:

你在你的SQL语法错误;检查对应于你的MySQL服务器版本正确的语法在1号线

+0

@JW。它具有HELP命令http://dev.mysql.com/doc/refman/5.0/en/help.html –

+0

根据TFM,您需要一个搜索字符串http://dev.mysql.com/doc/refman/ 5.0/en/help.html –

+1

单独帮助不是查询 –

回答

1

显示您指定的关键字使用HELP时,如使用“”附近的手册。

HELP 'contents' 
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

HELP 'SEARCH_STRING'

1

HELP ;将返回该错误。尝试使用HELP 'statement or keyword or operator' ;获取有关特定关键字的帮助。

如果您想了解哪些关键字/运营/报表可用于HELP使用,使用此:

HELP '%' ;