question

I wrote this, and I don’t get why it doesn’t get data from two different tables, it only takes from “stations” not “tags”. I tried so many ways, I’m just desperate!

<?php // Connect to Database $data = mysql_query("SELECT * FROM stations") or die(mysql_error()); Print ""; while($info = mysql_fetch_array( $data )) { Print ""; Print " "; $sql=mysql_query("SELECT * FROM tags WHERE idStation= ".$info['idStations'].""); $res = mysql_query($sql); $row = mysql_fetch_array($res); $id = $row['idStation']; Print ""; } Print "
id: ".$info['idStations'] . "Station: ".$id . "
"; ?>

Thanks!

try to check it out $info[‘idStations’], give an echo there and check what is going there as parameter

Sponsor our Newsletter | Privacy Policy | Terms of Service