- Avoiding the use of ordinal() in an already-deployed enum
- Converting a recursive code to reverse a string into an iterative one in c++
- sensitize vars on form submit
- Are pure-bloods actually a distinct species from Muggles?
- Is this query nesting Right?? I am trying to connect 3 tables users,groups,users_groups?
- MSSQLServer Database Level Roles for Creating Tables
- Delete latest data from mongodb collection
- Getting an error ORA-00933 while using EXECUTE IMMEDIATE
- Rebuild transaction logs
- SQlite schema for table that contains server stats
- ExceptionConnection Timeout Expired.
- Oracle Internal Error
- How can I convert currency symbol to universal font?
- Typeface used in Garmin GPS device
- How to make a video of a counter e.g.100-1,000,000?
- What is a typical response from webserver for POST request?
- Is Tor used to perform hostile hacking?
- What are the new security features in Windows 10?
- Webauthn and TLS channel binding
- How to check hosted content for fraud?
How to upload data from raspberry pi to mySQL, geting errors
Basically i am trying to upload the data collected from my raspberry pi to mysql, I have a table called DHT_data with columns 'datetime' using datatype timestamp, 'temp' using datatype numeric, 'hum' using datatype numeric as well. However using my python script shown below i keep getting errors like indentation error or syntax error. I am currently new to programming so i don't really know whats the problem. Would appreciate any help in finding the solution or rectifying any errors with the script since i am not sure if it works yet
from time import sleep
DHTpin = 4
db = MySQLdb.connect("localhost", "root", "dmitiot", "IOTassignmentBobo")
curs = db.cursor()
print("Successfully connected to database!")
print("Error connecting to mySQL database")
update = True
humidity, temperature = Adafruit_DHT.read_retry(11, DHTpin)
if humidity is not None and temp