• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
query method return false?

well you can return your model

$sql    = "UPDATE notexistingtable SET active = true WHERE id = 123";
$result = $this->db->query($sql);
  return true;//or what ever you return here or maybe you display something like echo "true";
  return mysql_error();//or echo mysql_error();

[quote author="jmadsen" date="1309969819"]in order for this to work, you must go into


$db['default']['db_debug'] = TRUE;

and set it to FALSE;

If not, the DB_driver.php function will return the database error to the page, and "crash" it[/quote]

EXACTLY! That is the thing!

I got confused cuz I was getting this error printed on the page. But yes ... if db_debug is set to false, running the faulty query simply returns false. awesome!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.