help me with this little issues, i have two tables, taxi and hotel which have same column name "pangkalan1", and i wanna create some filter that , when i ran this query "SELECT * FROM taxi,hotel WHERE taxi.pangkalan1 = hotel.pangkalan1 AND taxi.pangkalan1 IN ('A','A');" and the results is list of taxi or hotel that have pangkalan1=A,and works , until i confuse with the fetch object in my sql
can anybody help me?
this my code
<?php
function datarelasi(){
$ambil = mysql_query("SELECT *
FROM taxi,hotel
WHERE taxi.pangkalan1 = hotel.pangkalan1
AND taxi.pangkalan1 IN ('A','A');");
While ($row=mysql_fetch_object($ambil)) {
$nama = stripslashes($row->taxi->nama);
Echo $nama;
}
}
echo datarelasi();
?>
the results is
Notice: Undefined property: stdClass::$taxi in C:\xampp\htdocs\dss\inc\relasi.php on line 21
Notice: Trying to get property of non-object in C:\xampp\htdocs\dss\inc\relasi.php on line 21
, i just want to fetch individual object from table, taxi->name, or hotel->name,
thanks