While loop only showing 1 result - php

I have a script that checks for dupe values in db and loops through the result and echoes the value using json. However, it is only displaying 1 record instead of 3 which is being sent to php. I would be grateful if someone could point out my error. Thanks
$boxitems = mysqli_real_escape_string($conn, $_POST['box']);
$array = array();
$array = $boxitems;
foreach ($array as $boxes) {
$sql = "SELECT item FROM act WHERE item = '".$boxes."' GROUP BY item HAVING COUNT(*) > 1";
$result = mysqli_query($conn, $sql) or die('Error selecting item: ' . mysqli_error());
$num_rows = mysqli_num_rows($result);
if($num_rows) {
while ($row = mysqli_fetch_array($result)) {
$data[] = $row['item'];
}
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: red; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo json_encode($data) . ' already exists. Please enter a unique box reference.';
echo '</div>';
exit;
} else {
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: #63c84c; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo 'No dupes found in database.';
echo '</div>';
exit;
}
}
UPDATED screen shot

Put what your want to echo into a single variable that is declared outside the foreach and concatenate each div (one for each loop your foreach does). And then echo it after the loop.
$boxitems = $_POST['box'];
$insertedItems = array();
$duplicateItems = array();
foreach ($boxitems as $boxes) {
$escapedBoxes = mysqli_real_escape_string($conn, $boxes);
$sql = "SELECT item FROM act WHERE item = '".$escapedBoxes."' GROUP BY item HAVING COUNT(*) > 0";
$result = mysqli_query($conn, $sql) or die('Error selecting item: ' . mysqli_error());
$num_rows = mysqli_num_rows($result);
if($num_rows) {
while ($row = mysqli_fetch_array($result)) {
$duplicateItems[] = $row['item'];
}
}
else
{
$insertedItems[] = $escapedBoxes;
}
}
if(!empty($duplicateItems)) {
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: red; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo json_encode($duplicateItems) . ' already exists. Please enter a unique box reference.';
echo '</div>';
} else {
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: #63c84c; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo 'No dupes found in database.<br/>';
echo json_encode($insertedItems) . ' has been entered successfully into the database.';
echo '</div>';
}
EDIT: Updated code considering u_mulder comment.

$boxitems = mysqli_real_escape_string($conn, $_POST['box']);
$array = array();
$array = $boxitems;
foreach ($array as $boxes) {
$sql = "SELECT item FROM act WHERE item = '".$boxes."' GROUP BY item HAVING COUNT(*) > 1";
$result = mysqli_query($conn, $sql) or die('Error selecting item: ' . mysqli_error());
$num_rows = mysqli_num_rows($result);
if($num_rows) {
while ($row = mysqli_fetch_array($result)) {
$data[] = $row['item'];
}
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: red; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo json_encode($data) . ' already exists. Please enter a unique box reference.';
echo '</div>';
exit;
} else {
echo '<div style="width: 50%; margin-bottom: 20px; border-radius: 5px; border: 1px solid black; background: #63c84c; font-size: 16px; color: white; height: 50px; padding: 15px; line-height: 1.3;">';
echo 'No dupes found in database.';
echo '</div>';
}
exit;
}
An exit inside any function, loop or condition will make the program to go out of it and continue, so it's not iterating through, it's exiting after the first iteration.

Related

HTML Table in PHP code overlap each other

I have two tables that are "To-do Tasks" and "Completed Tasks". I don't know why when I add new tasks to the To-do Tasks table, the table grow bigger and start overlapping the Completed Tasks table. I did set the max-width for the table to stop it but it didn't help. Can someone teach me how to fix it? Thank you
$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
foreach ($allTask as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
foreach ($allTaskComplete as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
CSS:
.complete_table{
border: 4px solid #5e001f;
border-collapse: collapse;
position: absolute;
top: 34%;
right: 1%;
width: 600px;
max-width: 600px;
}
.complete_table caption, .incomplete_table caption{
font-size: 17px;
color: #5e001f;
font-weight: bold;
border: 1px solid #5e001f;
border-radius: 7px;
padding: 7px;
background-color: white;
margin: 7px;
}
.complete_table th{
border: 1px solid #5e001f;
color: #5e001f;
padding: 7px;
}
.complete_table td{
border: 1px solid #5e001f;
padding: 7px;
color: #5e001f;
}
.incomplete_table{
border: 4px solid #5e001f;
border-collapse: collapse;
position: absolute;
top: 34%;
left: 1%;
width: 600px;
max-width: 600px;
}
.incomplete_table th{
border: 1px solid #5e001f;
color: #5e001f;
padding: 7px;
}
.incomplete_table td{
border: 1px solid #5e001f;
padding: 7px;
color: #5e001f;
}
.incomplete_table a, .complete_table a{
text-decoration: none;
color: #5e001f;
}
.incomplete_table button, .complete_table button{
width: 76px;
background-color: white;
font-size: 14px;
font-weight: bold;
border: 1px solid #5e001f;
border-radius: 7px;
}
try this:
$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
foreach ($allTask as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
echo "</table>";
$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
foreach ($allTaskComplete as $row) {
echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a
href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a
href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a
href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
}
}
echo "</table>";

Trouble inserting a CSS Grid into a flexbox layout

I am trying to insert a CSS grid layout within a flexbox layout so that 3 "grids" flex across a page row then the next three "grids" fill another row etc. At the moment all the "grids" line up in the centre of the page in one column when they should flex into rows of three abreast.
php code for itinery list page
<?php
include("assets/includes/header.inc.php");
include("config.php");
include("classes/ItineryResultsProvider.php");
if(isset($_GET['location'])) {
$location = $_GET['location'];
}
else {
exit("You must select an itinery location");
}
$page = isset($_GET["page"]) ? $_GET["page"] : 1;
?>
<body>
<section class="PageWrapper">
<section class='PageContentContainer'>
<?php
$resultsProvider = new ItineryListProvider($conn);
$pageSize = 18;
$numResults = $resultsProvider->getNumResultsItineryList($location);
$removeUnderscoreLocation = str_replace('_', ' ', $location);
echo "<div class='PageContentListCount'>
<h2>This page shows a list of $numResults suggested itineries for $removeUnderscoreLocation.</h2>
</div>";
echo $resultsProvider->getResultsItineryList($page, $pageSize, $location)
?>
<div class="PaginationGridContainer">
<div class="PaginationGridLogo">
<img src="assets/logos/Page_Numbering.png">
</div>
<div class="PaginationGridNumbering">
<?php
$pagesToShow = 10;
$numPages = ceil($numResults / $pageSize);
$pagesLeft = min($pagesToShow, $numPages);
$currentPage = $page - floor($pagesToShow / 2);
if($currentPage < 1) {
$currentPage = 1;
}
if($currentPage + $pagesLeft > $numPages + 1) {
$currentPage = $numPages + 1 - $pagesLeft;
}
while($pagesLeft != 0 && $currentPage <= $numPages) {
if($currentPage == $page) {
echo "<div class='PageNumberContainer'>
<span class='PageNumber'>$currentPage</span>
</div>";
}
else {
echo "<div class='PageNumberContainer'>
<a href='ItineryList.php?location=$location&page=$currentPage'>
<span class='PageNumber'>$currentPage</span>
</a>
</div>";
}
$currentPage++;
$pagesLeft--;
}
?>
</div>
</div>
</section>
</section>
</body>
</html>
php code for itinery list page classes
<?php
class ItineryListProvider {
private $conn;
public function __construct($conn) {
$this->conn = $conn;
}
public function getNumResultsItineryList($location) {
$query = $this->conn->prepare("SELECT COUNT(*) as total
FROM bth_itn_tbl WHERE ITN_STATUS='1'
AND ITN_LOCATION LIKE :location");
$searchTerm = $location;
$query->bindParam(":location", $searchTerm);
$query->execute();
$row = $query->fetch(PDO::FETCH_ASSOC);
return $row["total"];
}
public function getResultsItineryList($page, $pageSize, $location) {
$fromLimit = ($page - 1) * $pageSize;
$query = $this->conn->prepare("SELECT *
FROM bth_itn_tbl WHERE ITN_STATUS='1'
AND ITN_LOCATION LIKE :location
ORDER BY ITN_CLICK_COUNT DESC
LIMIT :fromLimit, :pageSize");
$searchTerm = $location;
$query->bindParam(":location", $searchTerm);
$query->bindParam(":fromLimit", $fromLimit, PDO::PARAM_INT);
$query->bindParam(":pageSize", $pageSize, PDO::PARAM_INT);
$query->execute();
$resultsItineryList = "<div>";
while($row = $query->fetch(PDO::FETCH_ASSOC)) {
$id = $row["ITN_KEY"];
$itnImg = $row["ITN_IMG_PATH"];
$title = $row["ITN_TITLE"];
$resultsItineryList .= "<div class='ItineryListFlexbox'>
<div class='ItineryListGrid'>
<a class='IntineryListGridImage'>
<img src='$itnImg' height='169' width='225'>
</a>
<a class='ItineryListGridTitle'>$title</a>
</div>
</div>";
}
$resultsItineryList .= "</div>";
return $resultsItineryList;
}
}
?>
CSS code. Note that the PageWrapper and PageContentContainer is generic for all pages and works fine. The issue is with the ItineryListGrid which is supposed to flex within ItineryListFlexbox. At the moment it is a vertical centred column within the PageContentContainer
.PageWrapper {
padding-top: 100px;
margin-bottom: 20px;
width: 100%;
display: flex;
justify-content: center;
flex-flow: row;
}
.PageContentContainer {
float: left;
margin: 0px 5px 5px 5px;
width: 710px;
border: 2px solid #111;
border-radius: 4px;
box-shadow: 6px 6px 4px #888888;
}
.PageContentListCount h2 {
margin: 20px 10px 20px 10px;
margin-left: 10px;
font-family: Catamaran;
font-size: 25px;
line-height: 30px;
font-weight: 900;
color: #111;
justify-content: left;
}
.PageContentContainer h3 {
margin: 0 0 15px 10px;
font-family: Catamaran;
font-size: 18px;
font-weight: 900;
color: #111;
}
.AdvertisingContainer {
float: right;
margin: 0px 15px 5px 5px;
width: 320px;
border: 2px solid #111;
border-radius: 4px;
box-shadow: 6px 6px 4px #888888;
height: auto;
display: flex;
flex-direction: column;
flex-wrap: wrap;
height: auto;
}
.ItineryListFlexbox {
display: flex;
flex-flow: row wrap;
justify-content: center;
height: auto;
}
.ItineryListGrid {
margin: 10px;
display:grid;
grid-template-columns: 225px;
grid-template-rows: 169px 50px;
grid-template-areas:
"IntineryListGridImage"
"ItineryListGridTitle";
}
.IntineryListGridImage {
grid-area: IntineryListGridImage;
}
.ItineryListGridTitle {
grid-area: ItineryListGridTitle;
text-align: left;
margin: 5px 0 5px 0;
text-decoration: none;
font-family: Catamaran;
font-size: 18px;
line-height: 20px;
font-weight: 900;
text-align: center;
color: #111;
}

PHP Customizing div to place next to each other

I have a problem. I created this code that shows products from my database like products:
<?php
include("connect.php");
session_start();
$status="";
if (isset($_POST['id']) && $_POST['id']!="")
{
$Id = $_POST['id'];
$result = mysqli_query($conn,"SELECT * FROM Producten WHERE `Id`='$Id'");
$row = mysqli_fetch_assoc($result);
$naam = $row['Naam'];
$id = $row['Id'];
$prijs = $row['Prijs'];
$foto = $row['Foto'];
$winkelwagen_array = array(
$id=>array(
'id'=>$id,
'naam'=>$naam,
'prijs'=>$prijs,
'hoeveelheid'=>1,
'foto'=>$foto)
);
if(empty($_SESSION["winkelwagen"]))
{
$_SESSION["winkelwagen"] = $winkelwagen_array;
$status = "<div class='box'>Product toegevoegd aan winkelwagen!</div>";
}
else
{
$_SESSION["winkelwagen"] = array_merge($_SESSION["winkelwagen"],$winkelwagen_array);
$status = "<div class='box'>Product toegevoegd aan winkelwagen!</div>";
}
}
?>
<html>
<head>
<link rel='stylesheet' href='css/style.css' type='text/css' media='all' />
</head>
<body>
<div style="width:700px; margin:50 auto;">
<?php
if(!empty($_SESSION["winkelwagen"]))
{
$winkelwagen_hoeveelheid = count(array_keys($_SESSION["winkelwagen"]));
?>
<div class="winkelwagen_div">
<img src="media/winkelwagen_logo.png" /> Winkelwagen<span><?php echo $winkelwagen_hoeveelheid; ?></span>
</div>
<?php
}
$result = mysqli_query($conn,"SELECT * FROM Producten");
while($row = mysqli_fetch_assoc($result))
{
echo "<div class='product_vak'>
<form method='post' actie=''>
<input type='hidden' name='id' value=".$row['Id']." />
<div class='foto'><img src='".$row['Foto']."' /></div>
<div class='naam'>".$row['Naam']."</div>
<div class='prijs'>€".$row['Prijs']."</div>
<button type='submit' class='koop'>Koop nu</button>
</form>
</div>";
}
mysqli_close($conn);
?>
<div style="clear:both;"></div>
<div class="melding_box" style="margin:10px 0px;">
<?php echo $status; ?>
</div>
</div>
</body>
</html>
with this css:
.product_vak {
float:left;
padding: 10px;
text-align: center;
}
.product_vak:hover {
box-shadow: 0 0 0 2px #e5e5e5;
cursor:pointer;
}
.product_vak .naam {
font-weight:bold;
}
.product_vak .koop {
text-transform: uppercase;
background: #F68B1E;
border: 1px solid #F68B1E;
cursor: pointer;
color: #fff;
padding: 8px 40px;
margin-top: 10px;
}
.product_vak .koop:hover {
background: #f17e0a;
border-color: #f17e0a;
}
.melding_box .box{
margin: 10px 0px;
border: 1px solid #2b772e;
text-align: center;
font-weight: bold;
color: #2b772e;
}
.table td {
border-bottom: #F0F0F0 1px solid;
padding: 10px;
}
.winkelwagen_div {
float:right;
font-weight:bold;
position:relative;
}
.winkelwagen_div a {
color:#000;
}
.winkelwagen_div span {
font-size: 12px;
line-height: 14px;
background: #F68B1E;
padding: 2px;
border: 2px solid #fff;
border-radius: 50%;
position: absolute;
top: -1px;
left: 13px;
color: #fff;
width: 14px;
height: 13px;
text-align: center;
}
.winkelwagen .verwijderen {
background: none;
border: none;
color: #0067ab;
cursor: pointer;
padding: 0px;
}
.winkelwagen .verwijderen:hover {
text-decoration:underline;
}
But when I load the page I see 2 products above each other in a very very large size. Now how can I get them to load next to each other and in a smaller size, because now they are filling the whole screen per product!
I already tried giving product_vak a width, but the image doesn't size with that!
How can I fix this?
try like this
.product_vak {
float:left;
padding: 10px;
text-align: center;
width:40%;

Table page number position problems

I have a problem with page numbers showing in footer on table. Here is my PHP code
<tfoot>
<tr>
<th colspan="5">Page</th>
?php
$sql = "SELECT COUNT(ID) AS total FROM Settings";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$total_pages = ceil($row["total"] / $results_per_page); // calculate total pages with results
for ($i=1; $i<=$total_pages; $i++) { // print links for all pages
echo "<th> <a href='example.php?page=".$i."'";
if ($i==$page) echo " class='curPage' </th>";
echo ">".$i."</a> </th>";
};
?>
</tr>
</tfoot>
CSS:
body {
font-size: 15px;
color: #343d44;
font-family: "segoe-ui", "open-sans", tahoma, arial;
padding: 0;
margin: 0;
}
table {
margin: auto;
font-family: "Lucida Sans Unicode", "Lucida Grande", "Segoe Ui";
font-size: 12px;
}
h1 {
margin: 25px auto 0;
text-align: center;
text-transform: uppercase;
font-size: 17px;
}
table td {
transition: all .5s;
}
/* Table */
.data-table {
border-collapse: collapse;
font-size: 14px;
min-width: 537px;
}
.data-table th,
.data-table td {
border: 1px solid #e1edff;
padding: 7px 4px;
}
.data-table caption {
margin: 7px;
}
/* Table Header */
.data-table thead th {
background-color: #508abb;
color: #FFFFFF;
border-color: #6ea1cc !important;
text-transform: uppercase;
}
/* Table Body */
.data-table tbody td {
color: #353535;
}
.data-table tbody td:first-child,
.data-table tbody td:nth-child(4),
.data-table tbody td:last-child {
text-align: right;
}
.data-table tbody tr:nth-child(odd) td {
background-color: #f4fbff;
}
.data-table tbody tr:hover td {
background-color: #ffffa2;
border-color: #ffff0f;
}
/* Table Footer */
.data-table tfoot th {
background-color: #e5f5ff;
text-align: right;
}
.data-table tfoot th:first-child {
text-align: left;
}
.data-table tbody td:empty{
background-color: #ffcccc;
}
Here is image
How to make this right? How to fit all pages numbers to end of table footer?
You just remove the th tag from the for loop . And echo the page no inside the th tag the give some space between the nos. Please replace your code with below given code.
This will work in your case.
<tfoot>
<tr>
<th colspan="5">Page</th>
<?php
$sql = "SELECT COUNT(ID) AS total FROM Settings";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
$total_pages = ceil($row["total"] / $results_per_page); // calculate total pages with results
echo "<th>";
for ($i=1; $i<=$total_pages; $i++) { // print links for all pages
echo " <a href='example.php?page=".$i."'";
if ($i==$page) echo " class='curPage' </th>";
echo ">".$i."</a> ";
};
echo "</th>";
?>
</tr>
</tfoot>

php/css error, don`t load Style to some objects

I got some strange problems with my php-code
when I try to output this echo "<div class='button menu' onclick=\"javascript:location.href='$baseURI'\">Menu</div>";
sometimes it don´t load the css, even not the div -tags, just the plain "Menu" string
and it´s always printed before my table -tags
how is this possible?
PHP-Code:
<?php
$root_dir = $_SERVER['PHP_SELF'];
echo "<link rel='stylesheet' href='style.css' type='text/css'>";
if (!isset($_GET['command'])) {
echo "<div class='button' onclick=\"javascript:location.href='$baseURI?command=show'\">Personaldaten anzeigen</div>";
//echo "<div class='button' onclick=\"javascript:location.href='$baseURI?command=new'\">neue Person anlegen</div>";
//echo "<div class='button' onclick=\"javascript:location.href='$baseURI?command=work'\">Personaldaten bearbeiten</div>";
} else {
if ($_GET['command'] == "show") {
openSQL();
$sqlbefehl = 'select * from kontakt';
#mysql_query("SET NAMES 'utf8'");
$ergebnis = #mysql_query($sqlbefehl); // SQL-Befehl an die Datenbank schicken
$spalten = #mysql_num_fields($ergebnis);
echo "<table class='style'>";
echo "<tr>";
for ($i = 0; $i < $spalten; $i++) {
echo "<th class='th'>" . mysql_field_name($ergebnis, $i) . "</th>";
}
echo "</tr>";
while (false != ($row = mysql_fetch_row($ergebnis))) {
echo "<tr>";
for ($i = 0; $i < sizeof($row); $i++) {
echo "<td>$row[$i]</td>";
}
echo "</tr>";
}
echo "</table";
}
echo "<div class='button menu' onclick=\"javascript:location.href='$baseURI'\">Menu</div>";
}
function openSQL()
{
$server = "127.0.0.1";
$user = "root";
$passwort = "";
$db = "schule";
$dblink = #mysql_connect($server, $user, $passwort);
if (!#mysql_select_db($db)) {
echo "<br>Keine Verbindung zur Datenbank $db möglich!";
echo "<br>" . mysql_error();
die();
}
}
?>
CSS-Code:
body{
font-family: Verdana;
color: #fff;
background-color: #000;
}
.style{
border-collapse: collapse;
text-align: center;
}
.style table,.style th,.style td {
border: 1px solid white;
}
.style td {
overflow: hidden;
font-size: 12px;
}
.button{
height: 68px;
width: 200px;
border: 3px orange solid;
margin-left: auto;
margin-right: auto;
text-align: center;
border-radius: 5px;
vertical-align: center;
font-size: 24px;
margin-top: 15px;
background-color: #000;
}
.menu{
height: 36px;
width: 75px;
}
.delBtn{
height: 36px;
width: 95px;
}
.del{
background-image: url(del.png);
background-repeat: no-repeat;
width:24px;
height: 24px;
background-size: 25px 25px;
}
.edit{
background-image: url(edit.png);
background-repeat: no-repeat;
background-position: center;
width:24px;
height: 24px;
background-size: 40px 40px;
}
So Im answering my own Question. It was the missing ">" at the closing table-tag. Since I fixed the missing character, the code now work properly.
Thanks for all of your effort <3

Categories