Trouble with Myqsl

Jon Ribbens jon+usenet at unequivocal.co.uk
Tue Apr 23 10:13:34 EDT 2002


In article <uloacus4pml1r7f7eac9ts3u20oroj34qb at 4ax.com>, Fernando Rodríguez wrote:
>>curs.execute(
>>    """insert into customer_info (email, url, referrer, first_visit)
>>    values ( %s, %s, %s, %s)""",
>>    ('billg at microsoft.com', 'www.easyjob.net', 'www.google.com', '2001-03-07
>>12:32:00')
>>)
> 
> mysqldb.error: (1064, "You have an error in your SQL syntax near
> '@microsoft.com, www.easyjob.net, www.google.com, 2001-03-07 12:32:00)' at
> line 1")

Woah, you have *seriously* screwed something up there. The code shown
is correct. I suggest you post the earlier part of your code where
your are connecting to the database and creating 'curs'.

Are you sure you really are doing dbc.execute(foo, bar) and not
dbc.execute(foo % bar)?



More information about the Python-list mailing list