Top "Prepared-statement" questions

A Prepared Statement (or parameterized statement) is a precompiled SQL statement that serves to improve performance and mitigate SQL injection attacks.

Call to a member function bind_param() on a non-object

I am trying to bind a variable in this prepared statement, but i keep receiving the error: Call to a …

php mysqli prepared-statement
Example of how to use bind_result vs get_result

I would like to see an example of how to call using bind_result vs. get_result and what would …

php mysql mysqli prepared-statement
Is there a way to retrieve the autoincrement ID from a prepared statement

Is there a way to retrieve the auto generated key from a DB query when using a java query with …

java mysql prepared-statement auto-increment
Getting java.sql.SQLException: Operation not allowed after ResultSet closed

When I execute the following code, I get an exception. I think it is because I'm preparing in new statement …

java mysql jdbc prepared-statement resultset
PHP UPDATE prepared statement

I'm trying to learn the proper way to use prepared statements to avoid SQL injections etc. When I execute the …

php mysqli sql-update prepared-statement
Return number of rows affected by SQL UPDATE statement in Java

I'm using a MySQL database and accessing it through Java. PreparedStatement prep1 = this.connection.prepareStatement( "UPDATE user_table SET Level = …

java mysql sql prepared-statement rowcount
How to set current date and time using prepared statement?

I have a column in database having datatype DATETIME. I want to set this column value to current date and …

java datetime jdbc prepared-statement
Bulk insert in Java using prepared statements batch update

I am trying to fill a resultSet in Java with about 50,000 rows of 10 columns and then inserting them into another …

java resultset bulkinsert prepared-statement
How to use a tablename variable for a java prepared statement insert

I am using a java PreparedStatment object to construct a series of batched INSERT queries. The query statement is of …

java sql variables dynamic prepared-statement