Hi there everyone!
I'm hoping to pull data from two tables, joined by ID:
/* Display the results like normal. */
/* Bar lights are type "1" in the citype_light table. */
$q_bl = "SELECT * FROM cart_items INNER JOIN citype_light ON cart_items.id = citype_light.id WHERE citype_light.type = '1' LIMIT 1";
$r_bl = mysqli_query ($link, $q_bl) or die(mysqli_error($link));
$num_bl = mysqli_num_rows($r_bl);
echo $num_bl;
while ($row_bl = mysqli_fetch_assoc ($r_bl)) {
print_r($row_bl);
}
but when I print $row_bl, it's only showing data from cart_items and not the citype_light. I would like it to contain the data from both tables. During my googling, I've come across GROUP BY but I'm not sure if that's the direction I should go in. I've not been able to get it to work yet.
Any insight would be greatly appreciated.
Thanks for your time!