Home Community Mys-Script Creative Off-Topic |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
We probably need to see the code snippet...
|
#3
|
||||
|
||||
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:
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#4
|
|||
|
|||
PHP Code:
|
#5
|
||||
|
||||
umm your query is wrong, try this:
PHP Code:
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#6
|
|||
|
|||
That works perfectly. Thanks a bunch HoF. <3
|
#7
|
||||
|
||||
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.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#8
|
|||
|
|||
Quote:
|
#9
|
||||
|
||||
@ 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...
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Database Query: COUNT(*) | Kyttias | Questions and Supports | 5 | 01-19-2015 04:57 AM |
CSS Query .-. | ChibiMaestro | Templates and Themes | 2 | 12-08-2012 06:51 AM |
Errors Running Mysidia | Inf3rnal | Questions and Supports | 10 | 03-04-2011 08:31 AM |
Join query for optimization? | Arianna | Questions and Supports | 2 | 04-09-2010 01:32 PM |
Problems getting the script running.... | milay | Questions and Supports | 7 | 03-08-2009 08:21 AM |
What's New? |
What's Hot? |
What's Popular? |