Hi below is a sql query that does not function correctly. This query below should show 1 invoice of the current selected customer. But somehow I can not manage to make this query work like shown below.
<?php
$id = (ISSET($_GET['id'])) ? intval($_GET['id']):0;
$clientnumber= (ISSET($_GET['clientnumber'])) ? intval($_GET['clientnumber']):0;
$sql = "SELECT *
FROM customers AS a
inner join invoices AS b on a . '$clientnumber' = b . '$clientnumber'
and a . '$id' != b . '$id'";
$result = $conn->query($sql) or die(mysql_error());
$query=getenv(QUERY_STRING);
parse_str($query);
?>
<?php while ($row = $result->fetch_assoc()) {?>
Echo sql results:
SELECT *
FROM customers AS a
inner join invoices AS b on a.'0' = b.'0'
and a.'4' != b.'4'