php - PDO bindParam() fatal error -
I am trying to learn PDO, now I have written this small code, but it gives me a serious error:
< P>
Fatal error: Call a member function at a non-object dot () ... I Trying to use Fatal error: Undefined method mysqli :: errorInfo ( ) ... can someone tell me what am I missing? Flaffeh said, you have PDO Missing Mysqy, try it:
$ con = new mysqli ("127.0.0.1", "root", "", "csvdangercheck"); $ Query = $ con- & gt; ("Id,` var1`, `var2`) values (" id,: var1,: var2) ";); $ query- & gt; bypass pattern (': id', $ id); $ query- & gt; BindParam (': var1', $ VAL1); $ Query- & gt; bindParam (': var2', $ val2); $ Query-> Executed ();
print_r ($ con-> errorInfo ()) but
$ con = new PDO ('mysql: host = 127.0.0.1; dbname = csvdangercheck', 'root', '');
Comments
Post a Comment