Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<form action="regconfig.php" method="POST">
                <div class="form-group row">
                  <div class="col-sm-6 mb-3 mb-sm-0">
                    <input type="text" class="form-control form-control-user" id="exampleFirstName" name='ufname' placeholder="First Name">
                  </div>
                  <div class="col-sm-6">
                    <input type="text" class="form-control form-control-user" id="exampleLastName" name='ulname' placeholder="Last Name">
                  </div>
                </div>
                <div class="form-group">
                  <input type="email" class="form-control form-control-user" id="exampleInputEmail" name='umailid' placeholder="Email Address">
                </div>
                <div class="form-group">
                  <input type="number" class="form-control form-control-user" id="exampleInputTel" name='uphno' placeholder="Mobile Number">
                </div>
                <div class="form-group">
                  <input type="text" class="form-control form-control-user" id="exampleInputId" name='uclgid' placeholder="College ID">
                </div>
                <div class="form-group row">
                  <div class="col-sm-6 mb-3 mb-sm-0">
                    <input type="password" class="form-control form-control-user" id="exampleInputPassword" name='upassword' placeholder="Password">
                  </div>
                  <div class="col-sm-6">
                    <input type="password" class="form-control form-control-user" id="exampleRepeatPassword" placeholder="Repeat Password">
                  </div>
                </div>
                <div class="btn  btn-user btn-block">
                <button type="submit" name="registerbtn" class="btn btn-primary btn-user btn-block" >Save</button>
                </div>
              </form>



What I have tried:

my code is about registration page
after creating on user into the database
Warning: mysqli_error() expects exactly 1 parameter, 0 given
Posted
Updated 27-May-20 20:36pm

Read the error message, it's pretty explicit:
C#
mysqli_error() expects exactly 1 parameter, 0 given

Then read the documentation for the function: PHP mysqli error() Function[^] and it says:
Parameter Values
Parameter	Description
connection	Required. Specifies the MySQL connection to use

Since you don't actually show us the PHP code you are using, we can't tell you exactly what to change, but you should be able to work that out for yourself - just add the relevant connection object as a parameter to the function call.
 
Share this answer
 
You should try to alter your problem line like so and you should be in good shape:

PHP
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error($myConnection));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900