The column aqbooksellers.deliverytime is actually : `deliverytime` int(11) DEFAULT NULL But it is used in several places as an integer. Defaut value should be 0 and not nullable.