I made a kind of plugin just for the database connection it works but if i activate my plugin the page wil go a little bit down so actually my site will become ugly
$servername = "xxxx"; // naam of ip van de machine ... 127.0.0.1
$username = "xxxx"; //naam van gebruiker
$password = "xxxx"; // wachtwoord
$dbname = "xxxx"; //db naam
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if (isset($_GET["code"]) )
{
$code = $_GET['code'];
}
else
{
$code = '';
}
//$naam = '%DR%';
//$sql = "SELECT * FROM docenten WHERE naam=\"$naam\"";
$sql = "SELECT * FROM `cadeaubon` WHERE Kortingscode like \"$code\"";
//echo $sql; //debuggen
echo "<BR>";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
echo "<table>";
while($row = mysqli_fetch_assoc($result)) {
echo "- ID: " . $row["ID"]. " - Kortingscode: " . $row["Kortingscode"]. " - Aantal personen: " . $row["AantPersonen"] . " - Naam: " . $row["Naam"] . " - Achternaam: " . $row["Achternaam"] . " - Leeftijd: " . $row["Leeftijd"] . " - Datum: " . $row["Datum"]."<br>";
}
echo "</table>";
} else {
echo "";
}
mysqli_close($conn);
this is my code and i thought maybe it will help if the result will display at the bottom of the page but i dont know how