|
|
|
|
|
|
Function mioDb_query | Language: PHP Product: MioDB |
Syntax
| mioDb_query(Database, Query, Fetch) |
Parameters
| STRING | Database | MySQL Database Name.
| | STRING | Query | Valid MySQL query.
| | BOOL | Fetch | Fetch the row. If this parameter is set to true, the function returns an array. The names of the columns are the names of the items in the array. If the parameter is set to false, the function returns a MySQL resource or the query result. |
Return value
Description
Selects a table, sends a query and, if the parameter fetch is set to true, fetch a result row as an associative array.
If the query returns more than one result, you must fetch the result with a for loop as shown in the sample below. |
PHP Sample Code
$query = miodb_query("database", "SELECT * FROM TableName", false);
for($ptr = 0; $ptr < mysql_num_rows($q); $ptr++) {
$data = mysql_fetch_array($query, MYSQL_BOTH);
echo($data['ColumnName']."<BR>");
} |
|
|
|