data

(/rs/public/functions.mysql.php)

data -- Handle to all rows selected in a table.

Description

resource data ($query)

This function executes a SELECT statement on a MySQL table and returns a resource handler to all the rows in the query.

$query is a valid MySQL SELECT statement without the word "SELECT". The function prepends $query with the word "SELECT" and a space.

You should use entry() to pull individual rows from the resource returned by this function.

This function returns false on failure.

Examples

data ("* FROM table") /* Returns resource to all columns and rows in table. */

data ("A, B FROM table WHERE C = D") /* Returns resource to A and B in any row that satisfies the WHERE clause C = D. Returns a resource to no rows if no rows satisfy the WHERE clause. */

data ("SELECT * FROM table") /* Returns false. Do not use SELECT in $query. */

Related Functions

entry, query

Dependencies

None.

Function Index