Hi, order is sql keyword too.
This might be helpful to you: http://web2py.com/books/default/chapter/29/6?search=check#Reserved-keywords Regards, Marin On Tue, Aug 7, 2012 at 3:05 PM, Hassan Alnatour <halna...@gardeniatelco.com>wrote: > Dear Marin, > > I change Like To Likes but i still get errors , the traceback is : > > > <class 'gluon.contrib.pymysql.err.**ProgrammingError'> (1064, u"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 'Order > VARCHAR(255),\n SEO_Keywords LONGTEXT,\n SEO_Description LONGTEXT,\n ' at > line 25") > > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12. > 13. > 14. > 15. > 16. > 17. > 18. > 19. > 20. > 21. > > Traceback (most recent call last): > File "C:\web2py\gluon\restricted.**py", line 204, in restricted > > exec ccode in environment > File "C:/web2py/applications/**latesti3zif/models/db.py" > <http://127.0.0.1:8000/admin/edit/latesti3zif/models/db.py>, line 298, in > <module> > > Field('SEO_Description','text'**)) > > File "C:\web2py\gluon\dal.py", line 5097, in define_table > > polymodel=polymodel) > File "C:\web2py\gluon\dal.py", line 705, in create_table > > self.create_sequence_and_**triggers(query,table) > > File "C:\web2py\gluon\dal.py", line 1348, in create_sequence_and_triggers > > self.execute(query) > > File "C:\web2py\gluon\dal.py", line 1359, in execute > > return self.log_execute(*a, **b) > > File "C:\web2py\gluon\dal.py", line 1353, in log_execute > > ret = self.cursor.execute(*a, **b) > > File "C:\web2py\gluon\contrib\**pymysql\cursors.py", line 108, in execute > > self.errorhandler(self, exc, value) > > File "C:\web2py\gluon\contrib\**pymysql\connections.py", line 184, in > defaulterrorhandler > > raise errorclass, errorvalue > ProgrammingError: (1064, u"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 'Order VARCHAR(255),\n SEO_Keywords LONGTEXT,\n > SEO_Description LONGTEXT,\n ' at line 25") > > > > > > > > > > On Tuesday, August 7, 2012 3:07:49 PM UTC+3, Marin Pranjić wrote: >> >> 'Like' is an sql keyword. >> >> On Tue, Aug 7, 2012 at 1:13 PM, Hassan Alnatour < >> halna...@gardeniatelco.com> wrote: >> >>> Dear ALL , >>> >>> I am trying to connect to mysql database and i keep getting this error : >>> >>> >>> *<class 'gluon.contrib.pymysql.err.ProgrammingError'> (1064, u"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 'Like INT,\n Sidebar >>> CHAR(1),\n Homepage CHAR(1),\n Order VARCHAR(255),\n ' at line 22")* >>> * >>> * >>> Traceback (most recent call last): >>> File "C:\web2py\gluon\restricted.**py**", line 204, in restricted >>> exec ccode in environment >>> File >>> "C:/web2py/applications/**latest**i3zif/models/db.py"<http://127.0.0.1:8000/admin/edit/latesti3zif/models/db.py>, >>> line 298, in <module> >>> Field('SEO_Description','text'****)) >>> File "C:\web2py\gluon\dal.py", line 5097, in define_table >>> polymodel=polymodel) >>> File "C:\web2py\gluon\dal.py", line 705, in create_table >>> self.create_sequence_and_**trigg**ers(query,table) >>> File "C:\web2py\gluon\dal.py", line 1348, in >>> create_sequence_and_triggers >>> self.execute(query) >>> File "C:\web2py\gluon\dal.py", line 1359, in execute >>> return self.log_execute(*a, **b) >>> File "C:\web2py\gluon\dal.py", line 1353, in log_execute >>> ret = self.cursor.execute(*a, **b) >>> File "C:\web2py\gluon\contrib\**pymys**ql\cursors.py", line 108, in >>> execute >>> self.errorhandler(self, exc, value) >>> File "C:\web2py\gluon\contrib\**pymys**ql\connections.py", line 184, in >>> defaulterrorhandler >>> raise errorclass, errorvalue >>> ProgrammingError: (1064, u"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 'Like INT,\n Sidebar CHAR(1),\n Homepage CHAR(1),\n >>> Order VARCHAR(255),\n ' at line 22") >>> >>> *This is the table in the Error :: >>> * >>> >>> * db.define_table('Videos', Field('Title'), Field('Hits','integer', >>> default=1), Field('Arabic_Title'), Field('Bits_on_The_Run_Script'), >>> Field('Youtube_Video_Url'), Field('Description','text',length=1000), >>> Field('Arabic_Description','text',length=1000), Field('Publish_Date',' >>> datetime',default=now), Field('Teacher',db.Teachers), >>> Field('Instroument',db.Instruments), >>> Field('Level',requires=IS_IN_SET(Course_level,zero=None)), >>> Field('Style'), Field('Video_Type',requires=IS_IN_SET(Video_type,zero= >>> None)), Field('Course_ID'), Field('Song_ID',db.Songs), >>> Field('Price',default=0), Field('Full_Course_Price',default=0), >>> Field('Cover','upload'), Field('PDF','upload'), Field('Like','integer', >>> default=1), Field('Sidebar','boolean'), Field('Homepage','boolean'), >>> Field('Order'), Field('SEO_Keywords','text'), Field('SEO_Description','text' >>> ))* >>> * >>> * >>> * >>> * >>> *What do you think is the problem , i tried a lot ?? please Help * >>> * >>> * >>> * >>> * >>> *Best Regards,* >>> >>> -- >>> >>> >>> >>> >> >> -- > > > > --