CREATE TABLE 'pedidos' (
'pk' int(3) UNSIGNED NOT NULL,
'residentes' varchar(50) COLLATE NOT NULL,
'dniFamiliar' varchar(10) COLLATE DEFAULT NULL,
'servicios' int(3) NOT NULL,
'fecha' datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci;
CREATE TABLE 'servicios' (
'codServicio' int(3) NOT NULL,
'concepto' varchar(50) NOT NULL,
'precio' float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1_spanish_ci;
I have these two tables, where orders are to make invoices. everything with php
I have to make a form in php with a select that I take the fields of the table services to do the invoicing and save it at the same time in a database. they ask me to do it with PDO oriented to objects, but I have no idea what that is, because I just did a 300-hour work stoppage and I have not even seen it and in practice they ask me for this, which does not sound to me. we only saw the basics of the basics The most I have come to do is this Concept:
<select>
<?php
include("conexion.php");
// Realizamos la consulta para extraer los datos
$query = $mysqli -> query ("SELECT * FROM servicios");
while ($valores = mysqli_fetch_array($query)) {
// En esta sección estamos llenando el select con datos extraidos de una base de datos.
echo '<option value="'.$valores[codServicio].'">'.$valores[concepto].'</option>';
}
?>
</select>
but it does not load anything to me, it does not leave error, nothing