Having a problem running a query
So what I'm trying to accomplish is every time the page changes/reloaded check to see if the user has won a random, mystery prize. Right now I have got the random prize page working and I already have the piece of code that randomly decides if the user wins something.
My problem is that it doesn't run my query to update the info in the table. I think my problem may be where I have put the code, which I currently have located in the functions.php. Any help would be greatly appreciated. Thank you much in advance. |
We probably need to see the code snippet...
|
umm the mysql update query wont work? Well I've had problems like this at times but theres really an easy way to debug. The mysql query string may have a typo in it, or the variables used to locate or update the database contain wrong information. To debug, lets consider the example below:
PHP Code:
|
PHP Code:
|
umm your query is wrong, try this:
PHP Code:
|
That works perfectly. Thanks a bunch HoF. <3 :usedusedused:
|
You are very welcome, glad it works out for you. Another quick note is that at times it does not work because you are using mysql's reserved word. I ran into this problem once, in which the field name 'usage' is a reserved word and thus cannot be used. Because of this I could not manage to create the table prefix.items_functions. I changed it to 'intent' instead and the problem is all gone.
|
Quote:
|
@ Fadillzzz: Yeah you are right, I actually tried that before but it still gave me an error. Turned out that I was using single quote instead of backticks, oh my...
|
All times are GMT -5. The time now is 09:11 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.