I have a simple form which passes a single entered name to an action page. The action page picks up the name entered and uses it in the function below. The objective is to identify and print out information on those records which have the form entered name.
The database name is office, the table being queried is members2
Below is the error message I am receiving. You will see that the name KANE is included in the error message - This is the name entered into the form for this particular test - proving to me that the form entry is available to the mysql query below.
Appreciate if you could have a look at the syntax - hopefully something obvious to the experienced eye !
sql = ("""select * from members2
where nom = %s""" %(name))
all_names = cursor.fetchall()
or: 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 '['kane
', 'Submit']' at line 2