I'm trying to add three queries:
$query1 = "SELECT * FROM sailors S";
$query2 = "SELECT * FROM boats B";
$query3 = "SELECT * FROM reserves R";
which i need to store in array:
$arr1 = array($query1);
$arr2 = array($query2);
$arr3 = array($query3);
I tried this :
$queryall =
"SELECT q1.sname, q1.age, q1.rating, q2.bname, q2.color, q3.rdate
FROM ($arr1) AS q1, ($arr2) AS q2, ($arr3) AS q3
WHERE q1.sid = q3.sid AND q2.bid = q3.bid";
but because of the arrays, it give me array to string conversion error
.
I need to join
those three tables while they are in arrays
, and get corresponding data.
How can i do such thing?