inconsistent results retrieving rows from mysql database...

/*
if $mls is numeric the code works fine but if its not then I don’t get output when i echo the rows
numeric or non numeric I get the echo to correctly display the $mls value
How can i get this code to work when $mls is not numeric???
*/
$result = mysqli_query($con,“SELECT * FROM tblListings WHERE MLS=$mls”);

echo “$mls”;
//echo “$result”;
while($row = mysqli_fetch_array($result, MYSQLI_BOTH))
{
echo $row[0];
echo $row[1];
}

put quotes around the variable .and make sure the table column is one of the text fields

Sponsor our Newsletter | Privacy Policy | Terms of Service