-1
if(isset($_POST['Klant'])){
try {
$stmt = $conn->prepare("SELECT (SELECT KltBedrijfsNaam from [tbl relaties] where KltId = auoKltId) as Naam, auoId, auoNaam from dbo.tblAutomatischeOrder where auoNaam in (
select auoNaam from dbo.tblAutomatischeOrder group by auoNaam having count(*) > 1
) and auoStatus= 'LO';");
$stmt->execute();
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="insert_container2">
<h2>Klanten Tabel</h2>
<p>Zoeken op bedrijven!</p>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Zoeken van bedrijven... ">
<table class="w3-table w3-striped w3-bordered w3-border w3-margin-top" id="myTable">
<tr>
<th>Bedrijf </th>
<th>ID van abbo </th>
<th>Abbo naam </th>
</tr>
<?php
foreach ($results as $row) {
echo "<tr>";
echo "<td>".$row['Naam']."</td>";
echo "<td>".$row['auoId']."</td>";
echo "<td>".$row['auoNaam']."</td>";
echo "</tr>";
}
?>
</table>
<?php
}
catch(PDOException $e) {
echo "Error: " . $e->getMessage();
}
$conn = null;
echo "</table>";
} The table of select看其来在公司PHP相同的订阅和MySQL
便利不来,我得到的是有超过1所订阅的所有公司。我想选择查询表明一个公司是否有两个单一订阅
请说明。是什么让最后两个项目变得特别?并且您的输出很难阅读,请使用字段和行分隔符。即使你的代码很难读... –
有相同的Naam的auoNaam,这是更好阅读 –
欢迎来到堆栈溢出!请参考[游览](http://stackoverflow.com/tour),环顾四周,并阅读[帮助中心](http://stackoverflow.com/help),特别是_ [我如何问一个好问题?](http://stackoverflow.com/help/how-to-ask)_。你不清楚你在上面问什么,你可以编辑你的问题来澄清? – Cagy79