Skip to content
Advertisement

Tag: mysql

Dropdown list issues

I’ve also been trying to set a default value in a dropdown box on HTML from the data I retrieved from MySQL. However, I noticed that if the user did not click on the dropdown box and clicked on one item from it. In other words, if they assumed the displayed value is the value they would like to submit

How to put date(parsed from csv) in Python to mysql?

I’ve made separate simple example just to check what method would work with date in my case and didn’t find any solution. we have: db table: code CSV file example_v2.csv: Trace Could you please assist in even find the documentation fit my case or indicate the direction. I’ve already tried a lot of methods such as: etc. Answer thanks to

POST on MYSQL database done in terminal but nothing in my base

I would like to know why all seems to be okay but nothing is insert in my mysql database ? I get some data from an api and I would like to insert data in table. Using flask, python, pymysql Thanks in advance traceback Answer Assuming that the INSERT statement looked good at that debugging print function, then you probably

How to convert a bytearray in a tuple in a list to a string?

I am trying to fetch data from my mysql database using python: This reads a column in my database called binaryValue, where every row is either a “0” or a “1” When I print out the variable “myresult”, it gives me a list where each item is a tuple: I need to get a string with either “0” or “1”

Flask-SQLAlchemy: ‘Table’ object has no attribute ‘query_by’

I’m developing an API with Flask and I cannot retrieve queries from a MySQL database I’ve connected with flask-sqlalchemy (not sqlalchemy alone). This is a pre-existing database downloaded from my client’s PHPMyAdmin, so I haven’t ran db.create_all(): I simply created the connection string in config.py, then instantiated db = SQLAchemy() and initialized it (db.init_app(app)) in my factory function (i’m using

I am trying to make a SQL query of Update in python but it is giving error

Error :- mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘:00 WHERE Contact_no = 9827355876’ at line 1 How can I do this to make a single query of SQL ? Answer You should be using a prepared statement here,

MySQL Query Passing Two Variables Python SQLConnector

I can’t seem to get two values passed on a query, I can get one variable to pass no problem, can’t figure out what I’m doing wrong, error posted when I try to use the two variable code, one variable code passes. One Variable: Two Variable: Error: Updated code after answer: Error: I am not sure I still get this

Advertisement