Welcome Guest, Not a member yet? Register   Sign In
Insert query failing when using $this->db->query() and not otherwise
#1

[eluser]Aeisor[/eluser]
I have a query that is failing using
Code:
$this->db->query()
, but if I use the value of
Code:
$this->db->last_query()
the query runs fine.

Code:
INSERT INTO users (forename, surname, phone, email, pass) VALUES (?, ?, ?, ?, ?)

becomes

Code:
INSERT INTO users (forename, surname, phone, email, pass) VALUES ('Name', 'Name', NULL, '[email protected]', 'password')

This does not return an error, or an object. It returns FALSE. Phone is allowed to be NULL. As it works directly (phpmyadmin and using mysqli_query), the query must be fine...

Any ideas?
#2

[eluser]Aeisor[/eluser]
I've done a var_dump inside mysqli_driver's _execute method and removed the @ suppression. Still nothing. Query fails and it shouldn't - at least not for a reason I can see. I hope I'm not looking for something more complicated than it is.
#3

[eluser]Aeisor[/eluser]
Too hasty. Seems there was a NOT NULL field that wasn't in the INSERT that didn't like the CI query (?) but didn't mind being run manually.




Theme © iAndrew 2016 - Forum software by © MyBB