Jeff Literal

Jeff Literal

  • NA
  • 16
  • 643

Warning: mysqli_query() expects at least 2 parameters, 1 is given in..

Aug 3 2020 9:26 AM
I can't figure out on where I get the error on lines 05 and 06. Please help.
  1. <?php    
  2. $config=mysqli_connect("localhost","root","");  
  3. mysqli_select_db($config,"dk");   
  4.    function register($id,$uname,$pass){    
  5.              $q="insert into users values ('$id','$uname','$pass')";    
  6.              mysqli_query("alter table users auto_increment = 1");    
  7.              if(mysqli_query($q)){    
  8.                  mkdir("$dir", 0700);    
  9.                  echo "<script language='javascript'>    
  10.     alert('User Registered');    
  11.     window.location = 'administrator.php';    
  12.     </script>    
  13.     ";    
  14.                      
  15.              }    
  16.              else{    
  17.                   echo "<script language='javascript'>    
  18.     alert('Registration Failed Or User Already Registered');    
  19.     window.location = 'administrator.php';    
  20.     </script>    
  21.     ";    
  22.              }    
  23.          }  
  24. ?>  

Answers (6)