I get this error message when a test new user registration using a form I created -
"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 ')' at line 1 SQL=INSERT INTO jos_users_visit VALUES ( 242 , 0 , 0, 0, ADDDATE("2010-08-31 15:16:38", 60),'','','','','','','','','',)"
Has anyone come across this and is there a fix?
"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 ')' at line 1 SQL=INSERT INTO jos_users_visit VALUES ( 242 , 0 , 0, 0, ADDDATE("2010-08-31 15:16:38", 60),'','','','','','','','','',)"
Has anyone come across this and is there a fix?
Hi equiweb,
I suspect that the problem is the double quotes in ADDDATE("2010-08-31 15:16:38", 60) - try with single quotes instead ADDDATE('2010-08-31 15:16:38', 60)
Bob
I suspect that the problem is the double quotes in ADDDATE("2010-08-31 15:16:38", 60) - try with single quotes instead ADDDATE('2010-08-31 15:16:38', 60)
Bob
Hi,
Actually, it's with the last "," at the end of the value-list; there's no value following it:
MySQL can use either ' or " to delimit strings. You can even use both in a single query, as long as they're not intended to delimit the same string.
/Fredrik
Actually, it's with the last "," at the end of the value-list; there's no value following it:
INSERT INTO jos_users_visit VALUES ( 242 , 0 , 0, 0, ADDDATE("2010-08-31 15:16:38", 60),'','','','','','','','','',)
MySQL can use either ' or " to delimit strings. You can even use both in a single query, as long as they're not intended to delimit the same string.
/Fredrik
HI Fredrik,
Yes, that makes sense. I was looking at the " right at the end and wondering if the whole string was wrapped in double quotes.
Bob
Yes, that makes sense. I was looking at the " right at the end and wondering if the whole string was wrapped in double quotes.
Bob
Hi,
They're easy to overlook. This though leaves the source for the improper query - as far as I can tell, #__users_visit belongs to the AUser plugin.
There seems to be a fix posted here: http://www.alikonweb.it/forum/1-auser-manager/1550-bugs-found-in-auser-manager-pack
/Fredrik
Edit: Actually, the "fixed" version seems to suffer from a bug capable of causing the above error:
The last value lacks the $db->Quote() method, causing it to be inserted as an empty string rather than '' if there's no value for $options['hscore']. There are a few similar pieces of code within the plugin that also needs fixing.
That said, the Author really should consider using column-lists with their INSERT queries.
They're easy to overlook. This though leaves the source for the improper query - as far as I can tell, #__users_visit belongs to the AUser plugin.
There seems to be a fix posted here: http://www.alikonweb.it/forum/1-auser-manager/1550-bugs-found-in-auser-manager-pack
/Fredrik
Edit: Actually, the "fixed" version seems to suffer from a bug capable of causing the above error:
$query = 'INSERT INTO #__users_visit VALUES ( '.(int) $result->id.' , 0 , 0, 0, ADDDATE("'.$now.'", '.$extend.'),'.$db->Quote($options['ip']).
','.$db->Quote($options['citta']).','.$db->Quote($options['stato']).
','.$db->Quote($options['countryname']).','.$db->Quote($options['latitude']).
','.$db->Quote($options['longitude']).','.$db->Quote($options['honey']).
','.$db->Quote($options['botscout']).','.$db->Quote($options['forumspam']).
','.$options['hscore'].')';
The last value lacks the $db->Quote() method, causing it to be inserted as an empty string rather than '' if there's no value for $options['hscore']. There are a few similar pieces of code within the plugin that also needs fixing.
That said, the Author really should consider using column-lists with their INSERT queries.
Hi, thanks for the replies but I am not sure what I should be editing. I get the same message when I use the normal Joomla registration after removing the form I created with ChronoForms, so is it one of the Joomla files or is it the database table that needs editing?
Pete.
Pete.
This topic is locked and no more replies can be posted.