mysql

unexpected keyword argument in execute statement

unexpected keyword argument in execute statement Question: def add_application_to_db(job_id, data): with engine.connect() as conn: sql = text( "INSERT INTO application(id,job_id,fullname,email,linkedin,education,experience,resumeurl) VALUES (:job_id,:fullname,:email,:linkedin,:education,:experience,:resumeurl)" ) conn.execute( job_id=job_id, fullname=data["fullname"], email=data["email"], linkedin=data["linkedin"], education=data["education"], experience=data["experience"], resumeurl=data["resumeurl"], ) I am learning flask and using MySQL and sqlalchemy.I am trying to store info from user into the data base (table name = …

Total answers: 1

Adding varible in SQL command not working with Select statment HELP please

Adding varible in SQL command not working with Select statment HELP please Question: x = int(id_[0]) select_query = "SELECT * FROM files WHERE id = %s" cursor.execute(select_query,x) results = cursor.fetchone() I am using mySQL in python This is the error i get: mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the …

Total answers: 1

update the value of a drop down filter according to the entry of the first

update the value of a drop down filter according to the entry of the first Question: I’m developing a flask application that filters the value of a Mysql database table and depending on the selected value of the first drop down it will update the value of the second drop down. and then finally return …

Total answers: 1

Invalid syntax when using the cursor.execute in python ( sagemaker notebook)

Invalid syntax when using the cursor.execute in python ( sagemaker notebook) Question: select * FROM HEVOPROD_DB.HEVOPROD_SCH.PRDNEW_METERING where REQUESTED_SERVICE = ‘["dsp"]’ and longitude is not null ; The above query works fine when i query this in snowflake while using this query in sagemaker notebook/ jupyter notebook it just fails stating invalid syntax important point here …

Total answers: 1

config flask app with a app.config.from_object

config flask app with a app.config.from_object Question: I have a flask app with MySQL DB i want to config my app with config.formobject(object) Then, I write the following class: import os class Config: DEBUG = True TESTING = False SESSION_COOKIE_SECURE = True SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:tool789@localhost/city’" SQLALCHEMY_TRACK_MODIFICATIONS = False SECRET_KEY = os.urandom(24) MAIL_SERVER = "Yourdomain" MAIL_USERNAME …

Total answers: 1

Why does SQL querry written in python gives me an error?

Why does SQL query written in python gives me an error? Question: I’m using selenium and undetected driver to scarp some information from website and compare them with data stored in MySQL MariaDB server on my vps. I done everything according to this tutorial: https://www.w3schools.com/python/python_mysql_where.asp After all it looks like this query = "SELECT polski, …

Total answers: 1

Python / MySQL – Python INSERT INTO not inserting data

Python / MySQL – Python INSERT INTO not inserting data Question: I’m testing a combination with Python and MySQL. For this example I want to insert data into a MySQL Database from my Python code. The problem I’m facing now is that there is no actual data inserted into the table when I run the …

Total answers: 1

TypeError: 'NoneType' object is not subscriptable, Discord Python Bot Mysql

TypeError: 'NoneType' object is not subscriptable, Discord Python Bot Mysql Question: Raw code: @ loop(hours=12) async def ticket_clear(): # try: cur.execute("SELECT auth_id, chann_id from tickets") for (auth_id, chann_id) in cur: channel = client.get_channel(chann_id) if (channel): return else: cur.execute( f"DELETE from tickets WHERE chann_id=%s", ((chann_id),)) conn.commit() # except: # print("Reconnecting") # await reconnect() Have some code …

Total answers: 1

GPS data storage system

GPS data storage system Question: I have a python script written using twisted module which is running on an ubuntu server as a service. We have many gps devices which sends data every 10 sec. My job is to parse that data and store it in database. Everything is working fine, but total number of …

Total answers: 2