Category : mysql-python

I’ve made a tkinter form that’s supposed to enter values into a MySQL table. However, when i enter the appropriate values int the form, I get the error message created by me ("All fields are required"). In the following code, a=task_name.get() [string], b=student_subject.get() [string], c=due_date.get() [int], d=priority.get() [int], e=task_type.get() [string], and f=date_added.get() [int]. ”’ def ..

Read more

I’ve created a form to insert values for a record into a MySQL table. This is the code for the insert function: ”’ def action(): if a=="" or b=="" or c=="" or d=="" or e=="" or f=="": messagebox.showmessage("Error" , "All Fields Are Required" , parent = wintask) else: con = mysql.connector.connect(host="<>", user="<>", password="<>", database="<>") cur ..

Read more

I am facing slow performance while connecting to a remote mariadb database from .exe built using pyinstaller on windows 10 as compared to directly from pycharm IDE. So, below is the sample code: import MySQLdb try: conn = MySQLdb.connect(host=database_host, port=database_port, user=database_user, passwd=database_password, db=database_name) except MySQLdb.OperationalError as e: # error message print(‘Error: ‘, e) If I ..

Read more

I am scraping a shopify store using the products.json page. Attempting to insert the scraped products into my MySQL DB using the Python connector, but hitting below error: Something went wrong: Failed executing the operation; b’Name‘ Code is below: import json import dataset import pandas as pd import mysql.connector import DrinkBetterScraperConfig as conf class myScraper(): ..

Read more

I need insert a variable to my table mysql, pero me marca error de sintaxis This is mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ”eventos’ (column) VALUES (‘prueba/prueba b’Luminosidad: 88”)’ at line 1 evento_message ..

Read more

When I query mysql with python and the query has datetime fields then I get this list as a result. [{‘_id’: 1, ‘name’: ‘index’, ‘_cdate’: datetime.datetime(2020, 10, 27, 9, 4, 34), ‘title’: ‘DataExtract’}, {‘_id’: 2, ‘name’: ‘topmenu’, ‘_cdate’: datetime.datetime(2020, 11, 4, 19, 52, 17), ‘title’: ‘topmenu’}, {‘_id’: 3, ‘name’: ‘functions_common’, ‘_cdate’: datetime.datetime(2020, 11, 4, 19, ..

Read more

import mysql.connector mydb = mysql.connector.connect(host=’localhost’, user=’root’ , database=’stockmarketbroker’, password=’qwer’) mycursor = mydb.cursor() name = ‘abc’ mail_id = ‘[email protected]’ phone_no = 1234 address = ‘PCMC’ bank_no = 9876 pan_no = ‘ASDF1234’ login_id = ‘abc.xyz’ password = ‘[email protected]’ stock_broker_Customer_ID = 456 stock_broker_Cusromer_Demat_ID = 1453 Customer_Acc_Balance = 0 query1 = """ USE stockmarketbroker; INSERT INTO stock_broker SET Customer_ID ..

Read more