Welcome Guest, Not a member yet? Register   Sign In
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!




Theme © iAndrew 2016 - Forum software by © MyBB