Warning: mysqli_error() expects exactly 1 parameter, 0 given in \Dequit\Midterm\register.php on line 18 -
register.php
<?php if($_post["password"]==$_post["cpassword"]) { $con=mysqli_connect("localhost","63327-10162995","123","63327-10162995"); if(mysqli_connect_errno()) { echo"failed connect mysql:".mysqli_connect_error(); } $sql="insert user(username,password,email,gender,fname,lname)values ('$_post[username]','$_post[password]','$_post[email]','$_post[gender]','$_post[fname]','$_post[lname]')"; if(!mysqli_query($con,$sql)) { die("error:".mysqli_error()); } echo"<script type='text/javascript'> window.alert('you have successfully\ registered new account!'); document.write('<?php header('location:http:lab203/63327/63327-10162995/desktop/dequit/midterm/mact1_dequit.html');?>') </script>"; mysqli_close($con); } else { echo"<script type='text/javascript'> window.alert('password not match!'); </script>"; } ?>
read mysqli_error. needs connection link argument.
so in case use this,
die("error:".mysqli_error($con));
Comments
Post a Comment