Because I do not take the values in method $ _POST | print_r () expects at most 2 parameters ... on line 5

0
    $habitacion=$_POST['habitacion'];
    $estado=$_POST['estado'];
    $personas=$_POST['personas'];

    print_r($habitacion,$estado,$personas);

            $query="SELECT * FROM habitacion WHERE hab_id='$habitacion'";
            $result=mysqli_query($conexion,$query);

            if($fila=mysqli_fetch_array($result)){
                            $sql="UPDATE habitacion SET hab_estado='".$estado."', hab_personas=".$personas." WHERE hab_id = ".$habitacion.")";
                            $res1=$conexion->query($sql);
                }

------------------------------------- HTML --------- -----------------------

<form action="Admin_FuncionalCambiarEstadoHabitacion.php" method="POST" class="needs-validation">
                  <div class="row">
                      <div class="col-md-3 mb-3">
                        <label for="habitacion">N° De Habitacion</label>
                        <select class="custom-select d-block w-100" id="habitacion" name="habitacion" required>
                          <option>Seleccione</option>
                          <?php include ('Admin_NumeroDeHabitacion.php'); ?>
                          </select>
                      </div>

                    <div class="col-md-3 mb-3">
                      <label for="estado">Estado De La Habitacion</label>
                      <select class="custom-select d-block w-100" id="estado" name="estado" required>
                          <option>Seleccione</option>
                          <option value="Disponible">Disponible</option>
                          <option value="Ocupado">Reservado</option>
                          <option value="Mantenimiento">En Mantenimiento</option>
                        </select>
                    </div>

                    <div class="col-md-3 mb-3">
                      <label for="personas">Numero De Personas</label>
                      <div class="input-group">
                        <input type="number" class="form-control" id="personas" name="personas" placeholder="Numero De Personas" required>
                        <div class="invalid-feedback" style="width: 100%;">
                          Your Number is required.
                        </div>
                      </div>
                    </div>
                  </div>
                <button class="col-md-4 btn btn-primary btn-lg btn-block" type="submit">Registrar</button>
              </form>
    
asked by Sergio CR 26.04.2018 в 08:40
source

1 answer

0

You are using the print_r() function with three parameters when you only support 2:

These are the specifications:

mixed print_r ( mixed $expression [, bool $return = false ] )
  • Expression: The expression to be printed.
  • Return: If you want to capture the print_r () output, use the parameter return. When the parameter is set to TRUE, print_r () will return the information instead of printing it.
  • If you want to see the variable $_POST do the following:

    print_r($_POST);
    

    This will print the entire array.

    Here you have more information about the feature.

        
    answered by 26.04.2018 / 08:45
    source