PHP » GoLang |
login |
register |
about
|
mysql_query(PHP 4, PHP 5) mysql_query — Send a MySQL query Warning
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include: Description
mysql_query() sends a unique query (multiple queries
are not supported) to the currently
active database on the server that's associated with the
specified Parameters
Return Values
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset,
mysql_query()
returns a resource on success, or
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc,
mysql_query() returns The returned result resource should be passed to mysql_fetch_array(), and other functions for dealing with result tables, to access the returned data. Use mysql_num_rows() to find out how many rows were returned for a SELECT statement or mysql_affected_rows() to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.
mysql_query() will also fail and return Examples
Example #1 Invalid Query
The following query is syntactically invalid, so
mysql_query() fails and returns
<?php
Example #2 Valid Query The following query is valid, so mysql_query() returns a resource.
<?php See Also
|
more
Recently updated
more
Most requested
more
Last requests
|