mysql_query(query[,link_identifier][,result_mode])

Description: Sends a query to the currently selected MySQL database on the MySQL server specified by link_identifier. If link_identifier is not specified, the last opened database connection is used.

The string query must be specified (without a semicolon at the end, as might be used with the mysql client program).

result_mode may optionally be specified, as either MYSQL_STORE_RESULT or MYSQL_USE_RESULT. Unspecified (the most commonly used form), it defaults to MYSQL_STORE_RESULT, which buffers the result on the client.

For queries that return a resultset (SELECT, SHOW, DESCRIBE, and so on), mysql_query() returns a resource identifier (called result in this appendix) if the query executes correctly ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.