Page 2 of 2

Re: PHP lying to me about results

Posted: Tue Feb 10, 2009 4:35 pm
by Benjamin
So this is what we know:

1. The query is valid and does not have any syntax errors.
2. The query works when tested from CLI
3. The query is being sent to the MySQL server
4. No errors are being returned
5. If the query is broken intentionally, an error IS being returned.

So let's assume that the query is working, but the updated record is not being reflected in the database. How could that happen? Have you checked mysql_affected_rows by chance? Not sure if you mentioned that already now that I am typing this out.

Re: PHP lying to me about results

Posted: Tue Feb 10, 2009 4:44 pm
by VladSun
pytrin wrote:... maybe Vlad has an idea
Nope :(

But I would consider this PHP side problem, not DB side... It looks like this...
You may try creating a clean file, write (no copy-pasting) the function and use this file instead.

PS: You don't have a call to stored procedure before this query, do you?

Re: PHP lying to me about results

Posted: Tue Feb 10, 2009 4:59 pm
by pickle
Nope - no stored procedures period.

I'll try re-writing the function - see if that fixes anything.

Re: PHP lying to me about results

Posted: Tue Feb 10, 2009 5:03 pm
by Benjamin
Not that I see this being a problem, but try changing the code for the query to this:

Code: Select all

 
$query = "UPDATE
                   `response`
                 SET
                   `number` = '$number'
                 WHERE
                   `response_id` = '{$this->response_id}'";
 

Re: PHP lying to me about results

Posted: Thu Feb 12, 2009 5:31 pm
by Benjamin
Did you ever figure out what the problem was pickle?

Re: PHP lying to me about results

Posted: Fri Feb 13, 2009 4:06 pm
by pickle
No. I was going to finish off this thread today, but you responded before I got a chance ;)

I have a limited number of hours paid for to work on this project & this little bug has taken 5 hours so far. The client has decided to remove the feature that was surrounding this bug, and move on to other things.

Bugs the hell out of me that I have absolutely no clue... but it's not my money.

Thanks for all the help everyone - it's at least a little re-assuring that the greatest minds the Internet has to offer is are just as stumped as I.

Re: PHP lying to me about results

Posted: Fri Feb 13, 2009 7:06 pm
by VladSun
pickle wrote:Thanks for all the help everyone - it's at least a little re-assuring that the greatest minds the Internet has to offer is are just as stumped as I.
:lol: :lol: :lol: