php - Trying to use prepare and bindParam to insert user data into SQL table -


User input is attempting to enter in the MYSQL database. I'm using because the column email is a unique key to prevent duplication. The name of the table is launch_email and I ready < Trying to prevent SQL injection by using / code> and bindParam , however I get this error: Call from the undefined function bindParam () Any solution?

PHP / SQL:

  is required (ROOT_PATH. "Inc / database.php"); Try {$ Replace = $ db- & gt; Prepare ("launch_change_imail values" ("email_star");); $ Place = binduparm (": email_str", $ email, pdo :: param_st); $ Replace-> Executed (); } Hold (exception $ e) {resonant "data could not be submitted to database."; Go out; }   

Edit: The code below has solved my problem. I was specifying a method for a non-object is required (ROOT_PATH. "inc / database.php"); Try {$ Replace = $ db- & gt; Prepare ("launch_change_imail values" ("email_star");); $ Substitution- & gt; Bindamuram (": email_str", $ email, pdo :: param_st); $ Replace-> Executed (); } Hold (exception $ e) {resonant "data could not be submitted to database."; Go out;

Remember the bundle classes are in PDO, MySQL or whatever database, reuse Is doing ... then it should be said in such a way:

  $ replace-> Dandruff (": email_str", $ email, PDO :: PARAM_STR);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -