"IN" is a keyword. I think you'll need to call the column something else.
Can you see the error message from SQLite? It should have said as much.
1-) (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
The error I get when I do is: sqlite3.OperationalError: 10 values for 9 columns
That's because your INSERT only named 9 columns to receive values but provided 10 values. I think you need to read these error messages more carefully.
What does the error message say? Have you read it?
And still I have not seen the error message, other than the message that the number of values does not match the number of parameters. Now you seem to have fixed that problem by (as commanded by the error message) making the number of parameters equal to the number of values.
Now you claim to have yet another different problem.
It is also likely that the error message will tell you EXACTLY what you have done wrong, and EXACTLY what circumstance will correct the error. Have you read the error message? Do you even know what the purpose of an error message is (hint -- it may be to tell you that YOU have made an error that YOU need to correct).
Until you report the error message you are seeing there can be no help for you.
You will note that even your ORIGINAL posting did not state what error message you were receiving, nor where you received it. Merely that you were "having some" and you did not know what to do.
The answer you SHOULD have been given was:
(a) read the error message
(b) fix your error that caused the message to appear
It was a guessing game to determine what YOUR problem was THAT YOU CREATED FOR YOURSELF BY NOT PAYING ATTENTION TO ERROR MESSAGES.
If you do not report the actual error message received together with the exact SINGLE LINE on which the error occurred, there can be no help for you.
cur.execute( "INSERT INTO Visitors (NAME, PHONE, COMPANY, PERSON, EXPLANATION, CARD_NO, DATE, GIRIS_SAATI, CIKIS_SAATI, ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)", (VisitorsName, VisitorsPhone, VisitorsCompany, VisitorsPersonDepartment, VisitorsExplanation, VisitorsCardNo, VisitorsDate, VisitorsIn, VisitorsOut) )
Those are wrapper errors in the wrapper (interface) you use, it's not SQLite errors.
I should think the Pyqt5 forum or usergroup should be able to shed some light on it.
With the error you get I would assume that "VisitorName" (which seems to be a string/text) is being pushed into a column that isn't so dedicated - not that SQLite would care about it, but the interface (wrapper) you use in Pyqt5 might care.
Do you have the database schema? Show how the table was created and we may perhaps have more thoughts, but honestly, you are far more likely to find help from the Pyqt5 people.
That would indicate that the "type" of binding paramter 0 (the first one) (that is VisitorsName) is not a "type" that is recognized by the Python sqlite3.py wrapper.
The wrapper only recognizes the following native Python types:
- unicode text (str)
- integer (or long in py2)
- bytearray/bytes/or other blob (buffer protocol conforming) type
You need to look at the
type(VisitorsName) and ensure that the reported type is one recognized by the sqlite3.py wrapper natively (listed above), or is one for which there exists either a prepare_protocol or other adapter registered.
The documentation for PyQt5 states that the .text() method on (what I presume) is an appropriate qt widget returns a
QString. This object type is not recognized by sqlite3.py hence you get an error message telling you that you have used an "unsupported type" since only native Python types (unicode/str/int/long/float/None/buffer) are "supported" and the type you have used (QString) has no converter/adapter/protocol registered to transform it to/from a standard supported type.