Victor Subervi wrote:
Hi;
I have this code snippet:
sql '''create table if not exists %sCustomerData (
ID tinyint(8) unsigned primary key auto_increment,
Email varchar(120) not null,
PhoneNumber varchar(20) not null,
BillingName varchar(80) not null,
BillingAddress1 varchar(100) not null,
BillingAddress2 varchar(100) null,
BillingCity varchar(50) not null,
BillingState varchar(2) not null,
BillingPostalCode varchar(8) not null,
ShippingName varchar(80) not null,
ShippingAddress1 varchar(100) not null,
ShippingAddress2 varchar(100) null,
ShippingCity varchar(50) not null,
ShippingState varchar(2) not null,
ShippingPostalCode varchar(8) not null,
TypeOfCard set("VISA", "MasterCard", "AmEx", "Discover", "PayPal")
null,
CreditCardNumber tinyint(8) unsigned null,
CreditCardExpMonth tinyint(2) unsigned null,
CreditCardExpYear tinyint(4) unsigned null
);''' % store
It throws this error:
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] File
"/var/www/html/angrynates.com/cart/cart2.py
<http://angrynates.com/cart/cart2.py>", line 62, referer:
http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] );''' %
store, referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] ^,
referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] SyntaxError:
invalid syntax, referer: http://angrynates.com/cart/cart.py
[Mon Jan 04 09:23:54 2010] [error] [client 66.82.9.61] Premature end of
script headers: cart2.py, referer: http://angrynates.com/cart/cart.py
Variable "store" is defined. How is my syntax invalid? Total code follows.
If it was complaining that "store" wasn't defined, the exception would
have been NameError.
It's a SyntaxError because of the missing "=".
--
http://mail.python.org/mailman/listinfo/python-list