I'm trying to connect to a database that I created using this code:
<?php
function Conectarse()
{
$host="localhost";
$user="root";
$password="root";
$bda="toobebe_catalogo";
if (!($link=mysql_connect($host,$user,$password)))
{
echo "Error conectando a la base de datos.<br>";
exit();
}
else
{
echo "Éxito conectando con la base de datos.<br>";
}
if (!mysql_select_db($bda,$link))
{
echo "Error seleccionando la base de datos.<br>";
exit();
}
else
{
echo "Éxito al encontrar la base de datos.<br>";
}
return $link;
}
$conn=Conectarse();
$sql="SELECT * FROM toobebe-octubre";
$db_fila = mysql_query($sql,$conn);
$ok=1;
while (($row = mysql_fetch_array($db_fila)) && $ok)
{
$valor=mysql_query($sql,$conn);
if(!$valor)
{
$ok=0;
}
}
?>
But it fires this mistake when I execute it:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in ...
I've been searching, and to know: - Database exists
Permissions are correct
Table exists
Table is not null
Any idea on why this mistake is happening?
EDIT:
Added image with the mistake:

$sqldirectly into your database via PHPMyAdmin or something similiar? From the Docs:mysql_query() returns a resource on success, or FALSE on error.FALSE= boolean