Databases Reference
In-Depth Information
Non standard-conforming queries
Let us try another query, which works correctly in MySQL: SELECT * FROM book
WHERE language = 'en' . Sending it to the Validator produces a report as shown in
the following screenshot:
Each time the Validator finds a problem, it adds a message such as {error: 1} at the
point of the error and adds a footnote in the report. In this query, the language
column name is non-standard. Hence, the Validator tells us that it was expecting
an identifier at this point. Another non-standard error is reported about the use of a
LIMIT clause, which was added to the query by phpMyAdmin.
Another case is that of the backquote. If we just click on Browse for the book table,
phpMyAdmin generates SELECT * FROM `book` , enclosing the table name with
backquote. This is MySQL's way of protecting identifiers, which might contain
special characters, such as spaces, international characters, or reserved words.
However, sending this query to the Validator shows us that the backquotes do not
conform to standard SQL. We may even get two errors, one for each backquote.
Summary
This chapter helped us understand the purpose of query boxes and showed us
where to find them. It also gave us an overview of how to use the column selector,
the Query window options, how to get a history of the typed commands, multi-
statement queries, and finally, how to use the SQL Validator.
The next chapter will show how to produce multi-table queries without typing
much, thanks to phpMyAdmin's query generator.
 
Search WWH ::




Custom Search