Skip to content

v1 (stable)

/

Methods

queryRaw

With queryRaw, you will get back the raw RPC response. In contrast to the .query() method, this will not throw for errors that occur in individual queries, but will rather give those back as a string, and this will include the time it took to execute the individual queries.

Method Syntax
$db->queryRaw($query, $params);

Arguments

Type

Description

$querystring

The query to execute

$paramsassociative array

An associative array of parameters to bind to the query.

Example
// Query users with the firstname "Tobie", using parameters.
$response = $db->queryRaw(
	'SELECT * FROM users WHERE firstname = $firstname',
	['firstname' => 'Tobie']
);

// The same query without parameters.
$response = $db->queryRaw('SELECT * FROM users WHERE firstname = "Tobie"');

Was this page helpful?