Hello if you could help me, I am trying to take a row from a Mysql table, I don't need to go through the table I just want to take a single row.
$consulta_precio_seco="SELECT * FROM secos WHERE codigo=10" ;
$resultados_precio_seco=mysqli_query($conexion,$consulta_precio_seco);
$fila=mysqli_fetch_row($resultados_cargar);
echo $fila[0];
Somebody help me please.
mysqli_fetch_row
must receive as a parameter a result set, which is obtained withmysqli_query
.In your code that result set is called
$resultados_precio_seco
, but you are passing another variable that is$resultados_cargar
.To solve the problem it would be then:
Your query should look like this assuming you only want to get the values of each column but from a single row
If you want the results to be displayed one per row
As you can see the changes made are minimal, but they are the following