explain differences between two different updates
To sum it up:
The first approach (parameterized query/prepared statement) is best, because it
- is easy: automagical quoting and formatting of the parameters
- can be more efficient: the DBMS may optimize
- avoids fetching and storing the resultset (@Ansgar)
- scales better: would work for many records without change
- guards against SQL-Injection
The second approach is worse because not having features 1 - 5 and worst/naive because not checking for an empty recordset (@peter, @Cageman).