I created a a method in pythin so that user could login as a user or as an admin but the program is not working as I expected it to be, I am posting the whole program, but mainly the error is coming in login method as I am not able to create a proper logic required for the method.
Tag: mysql-connector
How to put each link separate in database with beautifulsoup python
Hello i would like to add each link seperate in the database. When i print out “new_lst” it displays every link so i think it wants to put the whole outcome in 1 row and now seperate. My code: Answer You are already iterating over with a for loop. Yes, it is putting the whole outcome in one line as
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
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
Exception when trying to import python mysql connector on raspberry pi
I’m trying to use the python MySQL connector on my Raspberry PI but I’m getting this error as soon as I add the import statement to the script. The same happens when I try to import only parts of it. The error: I used PIP to install the connector … … and also already tried to force-reinstall it: Answer This
Use python script to edit data in logstash
I have a logstash configuration that gets data from a MySQL database and sends the data to elasticsearch. This is my configuration: Everything’s working fine, but I need to add some columns that have values dependent upon other column values, so I tried writing a Python script to do this. Is there a way to execute a python script to
mysql connector with python formating
I wrote a simple script that shows the user a letter and he has to write a human name that starts with the same letter, but I am having a problem automatically compensating for the column name using a variable… Is there a suggestion? How do I replace the column name with the variable let? The error: Answer You just
MySQL Connector methods `fetchone` and `fetchmany` are not PEP 249 compliant
With Python 3.6.2 and MySQL Connector 2.1.6 package on Windows 10, not calling the execute method of a database cursor, or calling it on a non SELECT statement (CREATE, DROP, ALTER, INSERT, DELETE, UPDATE, etc.) yields the following results: PEP 249 explicitly states for the fetchone, fetchmany and fetchall methods: An Error (or subclass) exception is raised if the previous