Python Forum
mySQL Database error not resolving.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mySQL Database error not resolving.
#3
I agree with Larz60+. It is certainly line 61.
query="DELETE from clinicmaster WHERE labname ="+name
I guess "labname" is a char column. So the value has to be enclosed in single quotes.
query="DELETE from clinicmaster WHERE labname = '" + name + "'"
But this method is since long deprecated. I don't know exactly which version MySql uses, but in general you should use placeholders (usually a question mark or %s).
query="DELETE from clinicmaster WHERE labname = ?"
cursor.execute(query, (name,))
Reply


Messages In This Thread
mySQL Database error not resolving. - by cybertooth - Aug-30-2021, 07:10 AM
RE: mySQL Database error not resolving. - by ibreeden - Aug-30-2021, 05:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,457 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  Mysql and mysql.connector error lostintime 2 687 Oct-03-2023, 10:25 PM
Last Post: lostintime
  error 1102 (42000) incorrect database name 's' Anldra12 4 1,714 Jun-08-2022, 09:00 AM
Last Post: Anldra12
  Mysql Syntax error in pymysql ilknurg 4 2,377 May-18-2022, 06:50 AM
Last Post: ibreeden
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,119 Feb-09-2022, 09:55 AM
Last Post: ibreeden
  Error creating database with python and form? shams 3 2,382 Aug-02-2021, 02:00 PM
Last Post: deanhystad
  MYSQL.CONNECTOR ERROR DB1 8 3,862 Jul-23-2021, 03:31 AM
Last Post: DB1
  pool mysql error - not catch by try\except? korenron 1 2,154 Jul-05-2021, 11:26 AM
Last Post: ibreeden
  SaltStack: MySQL returner save less data into Database table columns xtc14 2 2,179 Jul-02-2021, 02:19 PM
Last Post: xtc14
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 error from Mysql call AkaAndrew123 1 3,460 Apr-28-2021, 08:16 AM
Last Post: AkaAndrew123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020