I get an extremely strange result when I run this query. Basically I want to get a list of all my clients who match a certain criteria but the second query searches for a column that doesn't exist. I have no idea why.
[code=php]$result = mysql_query("select usuario from tenercoche_concesionarios WHERE mesanteriorm1 > 1 ")
or die (mysql_error() );
$i = 0;
while ($row = mysql_fetch_assoc ($result))
{
$usuario1 = $row["usuario"]; echo $usuario1; echo "<br>";
$ausuario[$i]=$usuario1; echo $ausuario[$i];
$i=$i+1;
}
//Seleccionar uno por uno y :
echo "<br><br><br>";
$count = count($ausuario); echo $count;
for ($i = 0; $i < count($ausuario); $i ++)
{
$usuario2 = $ausuario[$i]; echo $usuario2; echo "<br>";
$result = mysql_query("select * from tenercoche_privado WHERE usuario = $usuario2")
or die (mysql_error() );
}[/code]
what I am getting is that it is searching for a column that is the first variable that is spewed out from creating the array in the first place.
see www.tenercoche.com/test.php