Echoing results of double query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Echoing results of double query

Post by Perfidus »

How is the best way to echo the results of this query?
I have been trying this but it doesn't seem to work:
<? echo $row["Precios.ene3"]; ?>

This is the query:

Code: Select all

$result=mysql_query("SELECT Disponibilidad.ene1, Disponibilidad.ene2, Disponibilidad.ene3, Disponibilidad.ene4, Disponibilidad.ene5, Disponibilidad.feb1, Disponibilidad.feb2, Disponibilidad.feb3, Disponibilidad.feb4, Disponibilidad.feb5, Disponibilidad.mar1, Disponibilidad.mar2, Disponibilidad.mar3, Precios.ene1, Precios.ene2, Precios.ene3, Precios.ene4, Precios.ene5, Precios.feb1, Precios.feb2, Precios.feb3, Precios.feb4, Precios.feb5, Precios.mar1, Precios.mar2, Precios.mar3, FROM Disponibilidad, Precios WHERE (Disponibilidad.Ref='$Ref' AND Precios.Ref='$Ref')",$link);
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you done:

Code: Select all

while ($row = mysql_fetch_assoc($result)) {
    echo '<pre>';
    print_r($row);
    echo '</pre>';
}
after the query to check what's in it - i.e. what the element names are?

Mac
Post Reply