0

Why do I receive an error message for this?

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

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

The output I receive:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

3

3 Answers 3

3

HELP; (without parameters) is an internal command of the MySQL command line tool rather than a SQL command:

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.

However, if you add a search string you do get a SQL command:

HELP 'search_string'

Sign up to request clarification or add additional context in comments.

Comments

1

you show specify a keyword when using HELP, eg.

HELP 'contents'

Comments

1

HELP ; will return this error. Try using HELP 'statement or keyword or operator' ; to get help on a specific keyword.

If you want to find what keywords/operators/statements are available for use with HELP, use this:

HELP '%' ;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.