December 2002
Beginner
640 pages
16h 41m
English
When a program has a live connection to a MySQL database, two functions are available for running a query: mysql_query() and mysql_real_query().
You can use these functions to run any kind of query: those that return a resultset (such as the SQL statements SELECT, DESCRIBE, and SHOW) and those that don't (such as INSERT, UPDATE, and DELETE). Initially we'll concentrate on queries that return a resultset, so you'll see how to run the query and process the data that is returned.
mysql_query() expects a string terminated by a null, whereas mysql_real_query() takes a counted string. For our simple examples, you can use mysql_query(); however, if you need to create a query that contains binary data (which may ...