11-20-2016, 05:16 PM
Sorry about that...I was mainly focused on the end of your query and missed the beginning.
Then if you want all the results it is
If you only need the first row or only expect one row and don't want to loop through results,
If you only need to know the number of rows returned...
Code:
$query = $db->query("SELECT * FROM users WHERE username = ? AND id = ?",array($value,$user->data()->id));
Then if you want all the results it is
Code:
$results = $query->results();
If you only need the first row or only expect one row and don't want to loop through results,
Code:
$first = $query->first();
If you only need to know the number of rows returned...
Code:
$count = $query->count();