Updating but not inserting on the database php
The values in the data array are treated as string literals.
See this section for information on using expression that is used as criteria for the rows to change.
You are responsible for ensuring that any dynamic content is interpolated into this string safely. The return value is the number of rows affected by the delete operation.
If you omit the second argument, the result is that all rows in the database table are deleted.
It can be useful to force the connection if you want to catch any exceptions it throws as a result of invalid account credentials, or other failure to connect to the server.
These exceptions are not thrown until the connection is made, so it can help simplify your application code if you handle the exceptions in one place, instead of at the time of the first query against the database.
Any other columns returned by the query are discarded.
However, this technique is not safe to use in an environment where multiple clients are inserting records to the database.This reduces risk of some types of security issues.You don't need to apply escaping or quoting to values in the data array. The Adapter saves the connection parameters, and makes the actual connection on demand, the first time you need to execute a query.This ensures that creating an Adapter object is quick and inexpensive.