You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm just wondering if there is a better way to bind object values to SQL queries.
For example, let's say I have the following object:
I want to insert these values into the DB.
I can do this:
But this is vulnerable to injection, right?
So if I use bindings, I can do this:
However, I've also passed the object directly into the query string, which I didn't see documented but works for some weird reason:
I'm just wondering, is my last example the best and most concise way of doing it, or is there a better way?
Beta Was this translation helpful? Give feedback.
All reactions