I make the connection to the database:
$db_host="localhost";
$db_nombre="prueba";
$db_user="root";
$db_pass="";
$link=mysql_connect($db_host, $db_user, $db_pass);
Now I make the query:
$strQuery = "SELECT id, nombre FROM persona";
$resultado = mysql_query ($strQuery);
When I try to browse the ResulSet using mysql_fetch_array:
while($arreglo = mysql_fetch_array ($resultado)) {
echo $arreglo ["nombre"];
}
Launches me the error
mysql_fetch_array () expects parameter 1
The fact is that if I recover the information as follows:
//Resultado 1
$arreglo = mysql_fetch_array ($resultado)
echo $arreglo["nombre"];
//Resultado 2
$arreglo = mysql_fetch_array ($resultado)
echo $arreglo["nombre"];
//Resultado 3
$arreglo = mysql_fetch_array ($resultado)
echo $arreglo["nombre"];
Print me the expected values.
Any ideas?