C
C#2y ago
Ossie

MySQL Connector Paramerts.AddWithValue, not working?

Hello, I'm trying to do a prepared mysql query, however it doesn't seem to wanna bind my values. My code is the following: https://sourceb.in/9gNZINmB4C It shows the follwing in my console with the debugs: https://i.imgur.com/AvlrWlV.png In my database it becomes like this: https://i.imgur.com/bSoRCD9.png Which tells me it doesn't bind my params to the SQL statement, am I doing something wrong? I tried following this: https://dev.mysql.com/doc/connector-net/en/connector-net-programming-prepared.html
Imgur
Imgur
2 Replies
Zendist
Zendist2y ago
Your SQL query is wrapping the prepared variable in single quotes. Remove that, otherwise it's just considered to be a static value.
Ossie
Ossie2y ago
Thanks!