|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
MySql error (#1064)
Hey, just wondering if anyone can help me out, I'm getting a syntax error, this is my code..
PHP Code:
this is the error.. MySQL Error #1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''image' ORDER BY image_date DESC' at line 1 |
|
#2
|
|||
|
|||
|
Change your ' to ` (single-quotes to backticks), or just remove them.
__________________
"A pawn is the most important piece on the chessboard -- to a pawn" |
|
#3
|
|||
|
|||
|
Quote:
Thanks, I'll try that.. ![]() |
|
#4
|
|||
|
|||
|
Quote:
Ok when I changed it to `image` I got this error.. MySQL Error #1146: Table 'theradar_phpAds.image' doesn't exist same when I don't have anything around the table name.. ![]() |
|
#5
|
|||
|
|||
|
Make sure you're in the right database and you have the proper table name (for example, make sure it's not supposed to be 'images' or something like that).
|
|
#6
|
|||
|
|||
|
Quote:
This is the mysql I used to create the table.. PHP Code:
|
|
#7
|
|||
|
|||
|
The error means you don't have a table called 'image' in the database 'theradar_phpAds'. Your CREATE statement's ok, so it must be in a different database.
|
|
#8
|
|||
|
|||
|
Strange, the 'theradar_phpAds is another database??
I'm using this: PHP Code:
to connect to the database, and this is that code: PHP Code:
have I done anything wrong there? Do I need to select the database in the main code? Sorry to be a pain.. Thanks for your help too by the way ![]() |
|
#9
|
|||
|
|||
|
Is that the only mysql_select_db call you've got? If you've got another one between that and your query, it'll overwrite your original. My guess is you have some ad rendering code (probably through an include()) that connects to a different database.
|
|
#10
|
|||
|
|||
|
Quote:
Yep, the only one I'm using, I'm also using phpAds, so do you think that's getting in the way? I'll move my db connection string to where my image table is supposed to go, hopefully that will fix it.. ![]() |
|
#11
|
|||
|
|||
|
Ok, so it's the phpAds which is causing the error, currently it's using this script to call in the Ad, is there anything I can do to make it stop screwing around with my other dbase??
PHP Code:
|
|
#12
|
|||
|
|||
|
Just run a mysql_select_db() call before your query (though depending on how your ads stuff is set up, you may have to reset it back to radar_phpAds afterwards -- but I doubt it).
|
|
#13
|
|||
|
|||
|
Quote:
Ahh nice.. thanks for your help! I've managed to get it working now.. ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > MySql error (#1064) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|