MySQL Syntax
The great thing about everything you do in MySQL is that the "code" is very easy for humans to read, as opposed to harder programming languages like C or C++. Very few special characters and symbols are required to create a MySQL query, and most queries consist entirely of English words!Strategies to Learn MySQL
The MySQL language is not as complicated as most programming languages, so the best way to learn is with direct examples. Because this tutorial focuses on the combination of MySQL and PHP, most of the examples are ready for you to copy, paste, and run on your web server.CAPITALIZATION in MySQL Queries
There are many keywords in MySQL, and a good programming habit when using ANY of these words is to capitalize them. This helps draw them out from the rest of the code and makes them much easier to read. Below is an example of a MySQL query written in PHP that retrieves all the data from a MySQL table named "example".- $result = mysql_query("SELECT * FROM example")
As you probably can tell "SELECT" and "FROM" are the MySQL keywords used in this query. Capitalizing them allows you to tell from a quick glance that this query selects data from a table.
You can view a complete list of MySQL keywords at List of Reserved MySQL Words, but don't worry about memorizing them. You could program relentlessly in MySQL for years without ever using all of the MySQL keywords.
0 comments:
Post a Comment