I have two tables in MySql.. First table's name is ANIMAL and second table's name is DESCRIPTION
HTML Code:
-----|------ ------|-------------|--------
ida | name idb | desc | barcode
-----|------ ------|-------------|--------
1 | eagle 1 | bla bla bla | 1,3,4
2 | lion 2 | cla cla cla | 3,4
3 | bird 3 | dla dla dla | 1,2,3
4 | bee 4 | ela ela ela | 2,4
-----|------ ------|-------------|--------
then I want to get all desc value from DESCRIPTION that related with bird in ANIMAL table. I tried with the following line code:
$check = mysqli_query($dbconnection, "SELECT desc FROM description LEFT OUTER JOIN animal ON description.barcode=animal.ida WHERE animal.name='bird'");
while($data=mysqli_fetch_array($check)) {
$result = $data['desc'];
}
but no result from my above line code. I have search in many tutorial but still no result too. Any solution how to get the data as I need? thanks before.
Bookmarks