Click to See Complete Forum and Search --> : someone to check this syntax plz


purefan
10-28-2005, 09:48 AM
greetings

$query = "SELECT 'ID', 'Ubicacion', 'Direccion', 'Foto1', 'Foto2', 'Precio', 'Cuartos', 'Garage', 'YrBlt', 'SqrFeetBlt', 'Piscina' FROM CaminoCasas";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$_ID = $row['ID'];
echo $_ID;

}

The connection to the db is working but this outputs ID and not the value of ID in the table/database

NogDog
10-28-2005, 10:20 AM
It's the quotes around the column names in the query, making them string literals instead of column names. Change them to back-quotes (`column`) and I think you'll be OK.