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

#11
[eluser]marjune[/eluser]
well you can return your model

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

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

config/database.php

$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  


Users browsing this thread:
1 Guest(s)


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