- Looking for word frequency data for the Google Books ngrams
- CME SDL WEB - Modify behaviour select item
- “had been suspended” In Google Serch
- Is “too few” equivalent to “not enough”?
- What is the name of the question part in the conditional sentences?
- Present Continuous (personal initiative), Present Simple (a voice of authority)?
- Financial limitation or financial capacity
- Jump or Jump over
- Who is/ are your favourite band?
- Is it possible for a clause to be reduced when it uses the verb “to be”?
- I have server without console ssh, how Can I work with Magento?
- How to get current Store Home URL outside of Magento (1.9)?
- Multiple select product attribute is not showing in front end
- Override Sales order history issue in magento2
- Magento 2 Admin Grid Add/Update Button
- Advanced search in sidebar categories
- Quotes show twicely on check out (shipping info) in magento 1.9
- Magento2 : How to show success message in checkout page on page load
- Magento EE - Can not install patch EE-18.104.22.168-22.214.171.124-2018-09-17-05-45-48.diff
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