Thread: The SQL Class
View Single Post
Old 01-29-2009, 01:00 PM   #78 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

php Code:
$sql = "INSERT INTO `table` SET `col` = 'value'";

$db->exeQuery($sql);
//$db->loadQuery($sql)->exeQuery();
 

An update query we don't need to get results from, so you don't need to call the getQueryResult() after you've executed.

However, if you need a result(such as when you're using "read" queries), you'd have to do this:
php Code:
$sql = "SELECT * FROM `table`";

$result = $db->exeQuery($sql)->getQueryResult();
//$result = $db->loadQuery($sql)->exeQuery()->getQueryResult();
 
__________________
Tanax is offline  
Reply With Quote