ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Strange problem with PHP5/MySQL update function [SOLVED]
I am having a strange problem with one of my scripts. I have a function that updates a user on my user table. The problem is that I call the function from one script and it executes fine, then I call it from another script and It gives me this error "DB Error: syntax error".
If I copy and paste that output it will execute just fine from the MySQL prompt. I also call this function from another script with no problems either.
Yes, that's my experience too: the semicolon shouldn't be necessary (at least not in any of the cases I've used mySQL and PHP).
Nevertheless:
1. You've satisfied yourself that your PHP is actually connecting to the database (the right database, the right user, and the right permissions).
2. You've satisfied yourself that the PHP is generating the "update" string correctly (you tried cutting/pasting your "echo", and it worked).
3. You can't think of any other variables (neither can I)
... so ...
4. You did at least make the *effort* to try adding the semicolon. Didn't you?
I tracked down what script was causing the error but I was looking at the wrong sql statement that caused the error. I fixed that statement, now it is working. Thanks for all of your time anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.