php - Warning: mysqli_real_query() expects exactly 2 parameters, 1 given (Register Page) [SOLVED] -
This error was encountered when I tried to create a registration page Warning: mysqli_real_query () Expecting precise 2 parameters, 1 tried to use mysql_query (), but then it says that it is old
this is index.php:
& Lt; Title & gt; Untitled Page & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form method = "POST" action = "reg.php" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; Username: & lt; / TD & gt; & Lt; Td> & Lt; Input type = "text" name = "username" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Email: & lt; / TD & gt; & Lt; Td> & Lt; Input type = "email" name = "email" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> First name: & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "fname" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Last name: & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "lname" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Password & lt; / TD & gt; & Lt; Td> & Lt; Input type = "password" name = "pass" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Amp; Nbsp & lt; / TD & gt; & Lt; Td> & Lt; Input type = "submit" name = "submit" value = "submit" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt; This is my config.php:
& lt ;? Php $ link = mysqli_connect ('localhost', 'root', '', 'reg')? & Gt; and my reg.php:
& lt; Php includes "config.php"; $ Username = $ _POST ['Username']; $ Email = $ _POST ['email']; $ Fname = $ _POST ['fname']; $ Lname = $ _POST ['lname']; $ Password = MD5 ($ _ POST ['pass']); $ Insert = 'INSERT users (Username, Email, FNL, Lanna, Pass) VALUES ("'. $ Username '' ',' '. $ Email' ',' '. $ Fname.' ',' '' $ Lname. '', ''. $ Password. ''; Mysqli_real_query ($ insert);? & Gt; reg.php I think the problem is the cause. / P>
As an error, you have the mysqli_real_query function this criterion is your mysqli $ link .
Comments
Post a Comment