← All built-ins / mysql_query()
mysql_query()
mysql_query(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $conn | resource | handle from mysql_connect() |
| $sql | string | SELECT/SHOW statement |
Return value
Rows as array of maps (column name => value), false on error.
Example
echo "rows = mysql_query($c, "SELECT id, name FROM users");";
rows = mysql_query($c, "SELECT id, name FROM users");
This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.