JSFiddle - React, Tailwind, and code Playground
JavaScript
<?php
$q=$_GET["q"];
// Load Joomla! configuration file
require_once('configuration.php');
// Create a JConfig object
$config = new JConfig();
// Get the required codes from the configuration file
$server = $config->host;
$username = $config->user;
$password = $config->password;
$database = $config->db;
$con = mysqli_connect($server,$username,$password,$database);
if (!$con)
{
die('Could not connect: ' . mysqli_error($con));
}
mysqli_select_db($con,$database);
$sql="SELECT * FROM cypg8_comprofiler WHERE cb_dealerid = '".$q."'";
$result = mysqli_query($con,$sql);
echo "<table border='1'>
<tr>
<th>Dealer Bedrijfsnaam</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['cb_dealerbedrijfsnaam'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>