![]() |
Updating a database!?
Hi guys, I have a question for you :)
This has been really annoying me recently, I am trying to update my database via a form which will be found in the ACP. I manage to display the original values in the forms and then when i click submit it says Forum CANNOT be updated. I have a tried a few methods, my last attempt being here. Can someone help me fix this or give me a version of an update form which will definitely work, please? Gareth SBB Alpha 2 (Powered by SBB) |
Hi Gareth,
Try changing your "Forum cannot be updated" error text to echo mysql_error() instead. That may give some clues as to why it isn't updating. A handy trick when debugging these sorts of mysql problems is to do the following: PHP Code:
Alan. |
Aha!
It comes up with: Quote:
Quote:
PHP Code:
|
You'll need to format the SQL query correctly. At the moment you have:
... VALUES ( Public, n/a, 1, 0 ) but you need it to look like: ... VALUES ( 'Public', 'n/a', 1, 0 ) |
Ahh, then the problem is with your update query syntax :)
Try changing it to: PHP Code:
More info on the SQL Update syntax here: MySQL AB :: MySQL 5.0 Reference Manual :: 11.2.10 UPDATE Syntax Alan. |
Also, be careful using "desc", it's a mysql keyword!!
|
Quote:
Alan. |
You guys are great! Thank you so much :)
I need to remember about desc, will change it sometime :P |
Yeah I've run into that terrible desc error so many times and never knew what it was!
Annoying little thing isn't it... haha |
|
| All times are GMT. The time now is 05:54 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0