Can't add values to mysql database

Advertisements I tried entering values to mysql database using python. In python there is no error but when I check in mysql the items haven’t been added yet. This is the code import mysql.connector as mc mc.connect(host=’localhost’,user=’root’,password=’password’,database=’school’) c=mc.cursor() cursor.execute(‘insert into class values({},'{}’,{})).format(rollno,name,fees) >Solution : Your code shouldn’t have worked properly beacuse you did not name… Read More Can't add values to mysql database

Error: '1064 (42000): You have an error in your SQL syntax

Advertisements I’m coding in Python using MYSQL to create a database recipe. I have written some variables to create different tables. All could be created except one that caused an error : create_recipe_ingredient_table = """ CREATE TABLE IF NOT EXISTS recipe_ingredient ( recipe_ingredient_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, amount INT, recipe_id INT, ingredient_id INT,… Read More Error: '1064 (42000): You have an error in your SQL syntax