mysqli_fetch_row
must receive as a parameter a set of results, which is obtained with mysqli_query
.
In your code that set of results is called $resultados_precio_seco
, but you are passing another variable that is $resultados_cargar
.
To solve the problem it would be then:
$fila=mysqli_fetch_row($resultados_precio_seco);
echo $fila[0];
NOTE ON OPTIMIZATION:
If you're only interested in one row, maybe you should limit the
results to a row, so as not to overload the database and the
server bringing unnecessary data. You can therefore write the
query like this: SELECT * FROM secos WHERE codigo=10 LIMIT 1
NOTE ON NAME CONVENTION
It might be useful if you use less extensive variable names. While this is no difficulty for the operation of the code, it is at the time of reading, writing, analyzing, organizing, understanding. It is not the same to have a variable called $resultados_precio_seco
if you call it for example $rsPrecioSeco
or have $consulta_precio_seco
instead of $sqlPrecioSeco
.