Welcome Guest, Not a member yet? Register   Sign In
mysqli update record returns error
#1

[eluser]Atasa[/eluser]
Anyone had this before?
What I do is
Code:
$where = $idColumn . " = " . $idValue;
$str = $this->db->update_string($tableName, $data, $where);
if ($this->db->query($str) === TRUE)
return $idValue;

Returns:

Quote:An Error Was Encountered
Error Number: 0
UPDATE news_categories SET PARENT_CATEGORY_ID = '-1', CATEGORY_TITLE = 'TEST2' WHERE CATEGORY_ID = 1

to my surprising eyes The Update happens but I couldn't figure out from where this error is coming from.

I use mysqli driver and this error it is driving me nuts!
#2

[eluser]Atasa[/eluser]
I submit also the log massages if someone can figure out somenthing.

DEBUG - 01-04-2008 14:49:51 --> Final output sent to browser
DEBUG - 01-04-2008 14:49:51 --> Total execution time: 0.0327
DEBUG - 01-04-2008 14:50:05 --> Config Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Hooks Class Initialized
DEBUG - 01-04-2008 14:50:05 --> URI Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Router Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Output Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Input Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Global POST and COOKIE data sanitized
DEBUG - 01-04-2008 14:50:05 --> Language Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Loader Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Helpers loaded: url
DEBUG - 01-04-2008 14:50:05 --> Database Driver Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Controller Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Model Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Helpers loaded: html
DEBUG - 01-04-2008 14:50:05 --> Menu class already loaded. Second attempt ignored.
DEBUG - 01-04-2008 14:50:05 --> Helpers loaded: html
DEBUG - 01-04-2008 14:50:05 --> Validation Class Initialized
DEBUG - 01-04-2008 14:50:05 --> Language file loaded: language/english/validation_lang.php
ERROR - 01-04-2008 14:50:06 --> Query error:
DEBUG - 01-04-2008 14:50:06 --> Language Class Initialized
DEBUG - 01-04-2008 14:50:06 --> Language file loaded: language/english/db_lang.php

Certainly CI sees a Query Error, but the funny thing is that it doesn't say wich is exactly the error if there is one,
and why the update query executes just fine.
#3

[eluser]Derek Allard[/eluser]
if you copy that sql and paste it directly into phpmyadmin, what happens?
#4

[eluser]Atasa[/eluser]
The statement runs smoothly without any problem.
#5

[eluser]Derek Allard[/eluser]
could you try echoing out a $this->db->last_query() if it will let you. That makes little sense to me. Can you construct the query in AR?
#6

[eluser]Atasa[/eluser]
Hi thanx for your reply,
I did try to echo the last_query() but it is impossible hence the error happens earlier i guess.
I thing I have to tell you a bit of the logic for the app i construct.
First I had problems with Stored Procedures executing more than one sql statement.
I was getting the very well known error "Command Out of Sync".

Therefore my workaround with CI was to change the _execute function in mysqli_driver.php
from mysqli_query to mysqli_multi_query.

Problem solved and I was very happy about it!!!

But when I came to Update a record i got in to this hell.
I also wrote a procedure for the update and try to execute like all other queries
but I was getting the same message.

Now this is really funny I say.

The only solution that worked since yesterday is to switch back to mysqli typo
Code:
if($result = mysqli_query($this->db->conn_id, $str))    
return TRUE;

Any idea?
#7

[eluser]Derek Allard[/eluser]
I'm not sure, but I'm moving this out of the bug forum since you've altered the driver. I still want you to get help with this, but its unfair to call it a CI bug if you've changed the code. I'm sure someone in the community will be able to help out, but as for me, I'm not sure how to help you from here.




Theme © iAndrew 2016 - Forum software by © MyBB