You are here : phpmysqlmysql_query

mysql_query() - mysql

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 link_identifier.


Syntax

mixed mysql_query ( string $query [, resource $link_identifier = NULL ] )


Example

<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
    die('Invalid query: ' . mysql_error());
}

?>


Output / Return Value

Returns Result from MySQL Query.


Limitations

This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0.


Alternatives / See Also

The MySQLi or PDO_MySQL Should be used.


Reference

http://in.php.net/manual/en/function.mysql-query.php