Don't have an account yet? You can create one, it is free, just click here
as a registered user you have some advantages like free downloads, comments and posting on our forums, depending upon this site's configuration and options.
Post subject: Classifieds MySQL syntax error after move
Hello,
I have moved to a new server with PHP 5.1.6 and MySQL 5 and have noticed a syntax error with my classifieds module 2.2 (Duster's) when submitting a new ad:
Quote:
Error: 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 'condition, add_date, exp_date, country_id, state_id, valid, mother_id ) VALUES (' at line 1
It seems that the message is cutoff for some reason.
To move servers, I have copied the whole database MySQL 4 and imported into the new database in MySQL 5 and everything is working fine except the classified module.
I have also tried removing it in admin/modules, it will deactivate but will not remove. So I've cleared it out MySQL manually and removed the files, then regenerated, then uploaded the files, regenerated again and initialized the module and it will not initialize. I've also searched through all the components/files and cannot find exactly where the problem exists.
Any suggestions or fix would be greatly appreciated.
_________________ Sept_de_Neuf
skyline5k MD user level 5
Joined: Dec 03, 2004
Posts: 109
Location: Shanghai, China
bannato
 Posted:
Apr 29, 2007 - 04:41 PM
I know this one is a few months old, but I'm now having the exact same problem. Is there a fix for this? Anyone know what needs to be changed to make this work?
Joined: Dec 03, 2004
Posts: 109
Location: Shanghai, China
bannato
 Posted:
Apr 29, 2007 - 05:48 PM
I found some details on the Technivore website, but seems people simply don't use that site, so I'll post the details gathered there so far: ( _____________) means end of conversation.
This hasn't helped me to get mine to work, but perhaps I'm missing something simple?
Quote:
I've just upgraded my server with mysql 5.0, but now I have some MySQL syntax error when I use PnZClassifieds (latest version).
Is there any patch?
Thanks very much for this wonderful module.
_____________________________
The reason behind the module breaking is from what i can see using a reserved name for a field naem in the classifieds_ads table the field in particular that is casuing the problem is the field used to describe the condition of the ad i.e the condition field. It seems that the word 'condition' is a reserved name in MySQL 5.
To fix the problem rename this field to ads_condition or something else that you can remeber easily, then edit the following files and replace all field name references to $condition to $ads_condition: the files in question are:
admin.php
account.php
printads.php
list.php
detail.php
common.php
admincommon.php
be careful if using a find replace as there are some label references label_condition also there is a filed reference a.condition this needs to be renamed to a.ads_condition, if using my renamed field name.
Good luck and hope u come right! Smile
__________________________
Maybe I am just missing some tiny entry somewhere, but I've tried altering this way several times and I still can't get it to make that table.
You said "be careful if using a find replace as there are some label references label_condition also"
Does this mean not to alter instances of label_condition, or does it mean to be sure not to miss doing so? I've tried it both ways with no success.
I am sure it would be a great gift to the community if someone who's successfully updated this module for MySQL 5, would make that version available for download.
_________________________
And it solved the problem with the reserved word "condition" in the sql DB just fine.
However!
I have a new problem:
Error: Unknown column 'country_id' in 'on clause' back
This is displayed when I try and view the contents of a category, or serach for an item. If i use the recently added list or directly view the detail of any item its fine.
Any ideas? I have tried everything I can think of!
This error only came after the upgrade from mysql 4.0 to 5.0.
______________________________________
Hi,
I had the same problems after upgrading to SQL5.
jabs, to solve the problem, please open index.php file, find the line:
Code:
$sql .= " FROM ".$prefix."_classifieds_ads , ".$prefix."_classifieds_category";^M
and replace it with:
Code:
$sql .= " FROM (".$prefix."_classifieds_ads , ".$prefix."_classifieds_category)";^M
But still is the problem with adding new classifieds. After filling form I receive next syntax error:
Code:
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 'condition, add_date, exp_date, country_id, state_id, valid, mother_id ) VALUES (' at line 1
Any ideas how to fix them?