Simple array problem help needed
Posted: Wed Nov 30, 2011 7:09 pm
Hello everyone,
I have a question with the use of the functon in_array... I have a list of categories in my table and I want to know if a specific category exists so I am doing this:
$categoriasexistentes= mysql_query("SELECT * FROM LugaresTuristicos WHERE DestinoPeg='$LinkDestino' GROUP BY Clasificacion ")
or die(mysql_error());
$array = mysql_fetch_array($categoriasexistentes);
print_r($array);
WHAT IS DISPLAYED BY print_r (there should be much more categories) IS THIS:
Array ( [0] => Bar [Clasificacion] => Bar )
If I ad this all categories are displayed:
while($categoria = mysql_fetch_array($categoriasexistentes))
{
$todas=$categoria['Clasificacion'];
?>
<?php echo"{$todas} - "; ?>
<?php
}; ?>
I have a question with the use of the functon in_array... I have a list of categories in my table and I want to know if a specific category exists so I am doing this:
$categoriasexistentes= mysql_query("SELECT * FROM LugaresTuristicos WHERE DestinoPeg='$LinkDestino' GROUP BY Clasificacion ")
or die(mysql_error());
$array = mysql_fetch_array($categoriasexistentes);
print_r($array);
WHAT IS DISPLAYED BY print_r (there should be much more categories) IS THIS:
Array ( [0] => Bar [Clasificacion] => Bar )
If I ad this all categories are displayed:
while($categoria = mysql_fetch_array($categoriasexistentes))
{
$todas=$categoria['Clasificacion'];
?>
<?php echo"{$todas} - "; ?>
<?php
}; ?>