Skip to content
Advertisement

Tag: mysql

How do I save scraped data to a MySQL database?

I have a python script that scrapes data from a job website. I want to save these scraped data to MySQL database but after writing the code, it connects to the database. Now after connecting, it doesn’t create table and as result couldn’t insert those data into the table. Please i need my code to store these scraped data to

How to put db name into query using %s

I have a following sql query: The tableA is in db-jablonec so I need to call db-jablonec.tableA. I use this method in Python: I call it like this: But I got an error MySQLdb.ProgrammingError: (1146, “Table ”db-jablonec’.tableA’ doesn’t exist”) Obviously, I want to call ‘db-jablonec.tableA’ not ”db-jablonec’.tableA’. How can I fix it please? Answer It is passing %s as its

Insert error in a Mysql query Flask web app

My app.py code : This is the error I get : I am using python 3.10.2 and flask 2.2.2 in my virtual environment. And I am using Visual Studio IDE. It seems like I am doing something wrong in the MYSQL query. can you guys tell me what am i doing wrong here. Answer You are missing a closing bracket

INSERT table names using SELECT statement in MySQL

In MySQL, I know I can list the tables in a database with: But I want to insert a table name into a specified table, for example: But when I execute the above statement, the dataset_names table does not get updated. I created the master table using: Here is the python code. Answer Here the order on insert values and

How to store CSV file in database?

There is a output file from Python Pandas with a lot of columns with headers. I need to be able handle this file by script and get CSV files in different columns positions. For example, initial file has columns As variation I need to get it in different sequence: I wonder what is the best way to store this file

Advertisement