exceptionerror
Hello , i got error when debug my program . Exception: Not All parameters were used in the SQL statement. What should i do ? How can write values of strings?
#------
#Connect MySQL
#------
cnx = mysql.connector
cursor= cnx.cursor()
#------
#MPU-DATA
#------
math functions
math functions
.
.
.
collect accel and gyro datas
.
x= x/scaler
y= y/scaler
z=z/scaler
return {'x': x, 'y': y, 'z': z}
def get_all_data(self):
gyro = get_gyro_data()
#------
#Insert new data
#------
while True :
mpu = MPU6050(0x68)
accel_data = mpu.get_
print(
print(
print(
gyro_data = mpu.get_gyro_data()
print(
print(
print(
Time = (time.strftime(
Date = (time.strftime(
print (Time + " - " + Date)
sql = ("""INSERT INTO `TAB_TEMP` (`Date`
args = (Date,Time,
try:
print ("Writing to database...")
# Execute the SQL command
# Apply changes
print ("Write Complete")
except:
# Rollback if error appears
cnx.close()
print ("Failed writing to database")
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: