I've currently got an SQL table, with duplicate entries. Some entries have more information than others, and I would like to get the entry with the most information. This is my code, which fails, and I'm not sure is appropriate to suit my needs.
"SELECT * FROM People WHERE Name='%s'
AND (Surname IS NOT NULL OR Surname IS NULL)
AND (Year_Born IS NOT NULL OR Year_Born IS NULL)
AND (Height IS NOT NULL OR Height IS NULL)
AND (Hair_Color IS NOT NULL OR Hair_Color IS NULL)
AND (Eye_Color IS NOT NULL OR Eye_Color IS NULL" % (name[0].get_child().get_text())
name[0].get_child().get_text()
-> contains the name of the person I would like to look up.
The only message I get, is the following one: "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 '' at line 1"