Good morning.
I'm trying to joke 3 tables and display in a list, but I'm not getting it. I've drawn (with LESS LINES) the tables in the database and an idea of how I'm trying to list the fields.
IthinkthatforthisIshoulddo3joins,butitisnotworking.
$i=0;$result=mysql_query("SELECT * FROM payment
LEFT JOIN booking ON payment.booking_id = booking.id
LEFT JOIN customer ON booking.customer_id = customer.id
WHERE (date >= '$datainicialsql' AND date <= '$datafinalsql') ORDER BY date") or die(mysql_error());
while ($linha = mysql_fetch_array($result)) {
$contador = $i;
$vcustomer = $linha["customer.name"];
$vtype = $linha["type"];
$vdate = date("d-m-Y", strtotime($linha["date"]));
$vvalue = $linha["amount"];
echo $i . $customer . " Name: $vcustomer" . " - " . " Date: $vdate" . " Type: $vtype" . " Date: $vdate" . " Amount: $vvalue" . "<br>";
$i++;
}