I am trying to fill bootstrap cards with data from a database.
I am very close.
I have the mainphp file called project.php
A file with a function called component to fill them, called component.php.
And a connectDB.php file, that connect the DB and extracts the information from a table.
I am aware this is alot of code so I highlighted 2 areas the problem is definitely in...Apologies if too much, I can remove the function if necessary as it works..
here is an extract from project.php
<?php
require_once('connect/connectDB.php');
require_once('component.php');
?>
<!doctype html>
<html lang="en">
<head>
<title>The Wild Music Shop</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--Font awesome-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!-- i have no idea why it won't link -->
<!-- <link type="text/css" rel="stylesheet" href="myCSS/somecss.css"> -->
<link rel="stylesheet" href="myCSS/somecss.css">
</head>
<body>
<!-- the cards -->
<div class = "container" id="thecards">
<div class = "row text-center py-5">
//Definite problem here
<?php
$result = getData();
while ($row = mysqli_fetch_assoc($result)){
component($row['InstName'], $row['Price'], $row['ProductImg'], $row['description']);
}
?>
</div>
</div>
</html>
This component definitely works as I tested it
<?php
function component($pInstName, $pPrice, $pProductImg, $pdescription){
$element = "
<div class=\"col-md-3 col-sm-6 my-3 my-md-0\">
<form action=\"index.php\" method=\"post\">
<div class=\"card shadow\">
<div>
<img src=\ $pProductImg\" alt=\"Image1\" class=\"img-fluid card-img-top\">
</div>
<div class=\"card-body\">
<h5 class=\"card-title\">Our $pInstName</h5>
<h6>
<i class=\"fas fa-star\"></i>
<i class=\"fas fa-star\"></i>
<i class=\"fas fa-star\"></i>
<i class=\"fas fa-star\"></i>
<i class=\"far fa-star\"></i>
</h6>
<p class=\"card-text\">
$pdescription
</p>
<h5>
<span class=\"price\">$$pPrice</span>
</h5>
<button type=\"submit\" class=\"btn btn-warning my-3\" name=\"add\">Add to Cart </button>
</div>
</div>
</form>
</div>
";
echo $element;
}
?>
and finally here is the connectDB.php
<?php
//Create a database connection
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "";
$dbname = "g00398295";
$connection = mysqli_connect($dbhost,$dbuser,$dbpassword,$dbname);
//Test if connection occoured
if(mysqli_connect_errno()){
die("DB connection failed: " .
mysqli_connect_error() .
" (" . mysqli_connect_errno() . ")"
);
}
if (!$connection)
{
die('Could not connect: ' . mysqli_error());
}
$sql = "select * from Instruments where itemno = 1; ";
$result = mysqli_query($connection,$sql);
$row=mysqli_fetch_assoc($result);
echo "Pls work".$row['InstName'];
mysqli_close($connection);
//get product from Database
//Definite problem here
function getData(){
$sql = "select * from $this->tablename";
$result = mysqli_query($this->con,$sql);
if(mysqli_num_rows($result) > 0){
return $result;
}
}
?>
I am awar the problem is somewhere in the connection step. I am very new to php in general and have been at this very long, I would appreciate help!
You have a function getData() that has "$this->table". Dont copy paste the codes without understanding what it does.
Clean up your connectDB.php:
<?php
//Create a database connection
$dbhost = "localhost";
$dbuser = "root";
$dbpassword = "";
$dbname = "g00398295";
$connection = mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname);
//Test if connection occoured
if(mysqli_connect_errno()){
die("DB connection failed: " .
mysqli_connect_error() .
" (" . mysqli_connect_errno() . ")"
);
}
?>
In project.php:
<div class = "row text-center py-5">
//Definite problem here
<?php
$sql = "select * from Instruments where itemno = 1; ";
$result = mysqli_query($connection,$sql);
while ($row = mysqli_fetch_assoc($result)){
component($row['InstName'], $row['Price'], $row['ProductImg'], $row['description']);
}
?>
</div>
I am trying to create a dynamic tab with PHP and MySQL using the Bootstrap Framework.
I am wondering why the dynamic tab is squeezed together. In addition, when I click the tab, it does not change color to show that I clicked that tab.
Actual Result:
The tabs 'Now Showing' and 'Coming Soon' are squeezed together. The selected tab does not change color even when it is clicked.
Expected Result:
The tabs 'Now Showing' and 'Coming Soon' should not be squeezed together. When either of the tab is clicked, that particular tab should change color.
How do I solve this problem such that the tabs will not be squeezed together AND the tabs will change color when it is clicked (to differentiate it from the tabs that are not clicked ---> as shown in the Expected Result)
Here are my codes:
<?php
$servername = 'localhost';
$username = 'root';
$password = '';
$dbname = 'movie';
$conn = new mysqli($servername, $username, $password, $dbname);
$tab_query = "SELECT * FROM category ORDER BY Category_ID";
$tab_result = mysqli_query($conn, $tab_query);
$tab_menu = '';
$count = 0;
while ($row = mysqli_fetch_array($tab_result)) {
if ($count == 0) {
$tab_menu .= '<li class="active">' . $row["Category_Name"] . '</li>';
} else {
$tab_menu .= '<li>' . $row["Category_Name"] . '</li>';
}
$count++;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Testing Movie Website</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<!--Bootstrap CSS-->
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity=
"sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--Custom CSS-->
<link rel="stylesheet" href="css/main.css">
<!--jQuery-->
<script defer
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<!--Bootstrap JS-->
<script defer
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"
integrity="sha384-6khuMg9gaYr5AxOqhkVIODVIvm9ynTT5J4V1cfthmT+emCG6yVmEZsRHdxlotUnm"
crossorigin="anonymous"></script>
<script defer src="js/main.js"></script>
</head>
<body>
<?php include "nav.inc.php"; ?>
<div class="container">
<br>
<ul class="nav nav-tabs">
<?php echo $tab_menu; ?>
</ul>
</div>
</body>
</html>
I followed this video: https://www.youtube.com/watch?v=qkmqncXTiLU
The structure and classes for .tabs is:
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
</ul>
Looks like you missed some classes.
The active class needs to go to <a> tag and the <li> tag needs a class nav-item. This will make it work. So it should essentially be:
<?php
while ($row = mysqli_fetch_array($tab_result)) {
if ($count == 0) {
$tab_menu .= '<li class="nav-item"><a class="nav-link active" href="#' . $row["Category_ID"] . '" data-toggle="tab">' . $row["Category_Name"] . '</a></li>';
} else {
$tab_menu .= '<li class="nav-item"><a class="nav-link" href="#' . $row["Category_ID"] . '" data-toggle="tab">' . $row["Category_Name"] . '</a></li>';
}
$count++;
}
I'm making a website for school about MLB with a database. But now I want information in the database as an option in a dropdownlist. This is my HTML Code:
<!DOCTYPE html>
<html>
<head>
<link rel="icon" type="image/png" href="./images/favicon-32x32.png"
sizes="32x32" />
<link rel="icon" type="image/png" href="./images/favicon-16x16.png"
sizes="16x16" />
<title>MLB: Major League Baseball</title>
<link href="css folder/MLBstylesheet.css" rel="stylesheet"
type="text/css"/>
</head>
<body>
<div id="container">
<div id="titel">
<img class="MLBTitel" src="./images/MLBtitel.jpg" alt="MLBTitel" >
<div id="titeltekst">
MAJOR LEAGUE BASEBALL
<br>
</div>
<nav>
<ul>
<li><a class= "menu" href="index.html">Home</a></li>
<li><a class= "menu" href="spelers.php">Spelers</a></li>
<li><a id = "active" class= "menu" href="teams.php">Teams</a></li>
<li><a class= "menu" href="wedstrijden.html">Wedstrijden</a></li>
<li><a class= "menu" href="contact.html">Contact</a></li>
</ul>
</nav>
<br><br>
</div>
<div id="teamtabel">
<?php
$servername = "localhost";
$username = "id1419279_root";
$password = "*******";
$dbname = "id1419279_mlb";
// Create connection
$conn = new mysqli($localhost, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM teams";
$result = $conn->query($sql);
echo "<select name='naamteam'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['teamnaam'] ."'>" . $row['teamnaam'] ."
</option>";
}
echo "</select>";
?>
</div>
</div>
</body>
</html>
The options would be the teamnames, but it seems like my dropdownlist is still empty: picture of the dropdownlist on the website
This is what my database looks like:
picture of my database
I hope someone could help me and I would really appreciate it.
<!DOCTYPE html>
<html>
<head>
<link rel="icon" type="image/png" href="./images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./images/favicon-16x16.png" sizes="16x16" />
<title>MLB: Major League Baseball</title>
<link href="css folder/MLBstylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="container">
<div id="titel">
<img class="MLBTitel" src="./images/MLBtitel.jpg" alt="MLBTitel" >
<div id="titeltekst">
MAJOR LEAGUE BASEBALL
<br>
</div>
<nav>
<ul>
<li><a class= "menu" href="index.html">Home</a></li>
<li><a class= "menu" href="spelers.php">Spelers</a></li>
<li><a id = "active" class= "menu" href="teams.php">Teams</a></li>
<li><a class= "menu" href="wedstrijden.html">Wedstrijden</a></li>
<li><a class= "menu" href="contact.html">Contact</a></li>
</ul>
</nav>
<br><br>
</div>
<div id="teamtabel">
<?php
$servername = "localhost";
$username = "id1419279_root";
$password = "*******";
$dbname = "id1419279_mlb";
// Create connection
$conn = new mysqli($localhost, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM teams";
$result = $conn->query($sql);
$dropdownlist = '';
while($row = mysqli_fetch_array($result)) {
$teamnaam = $row['teamnaam'];
$dropdownlist .="<option value='" . $teamnaam . "'>" . $teamnaam . "</option>";
}
if(isset($dropdownlist)){
echo "<select name='naamteam'>";
echo $dropdownlist;
echo "</select>";
}
?>
</div>
</div>
</body>
</html>
I'm working on a movie database project and I got my database the way it needs to be, but having issues with the front-end part of it. I finally got it to show all the information and have it be clickable, but I'm pretty sure this isn't the way to do it.
I'm having trouble displaying the genres. I either can groupconcat and display all of them like that, but then I can't have them be links or I could do them individual and have the links, but not get them all. I finally got them all, but then when I try it on the phone or tablet I only see the last genre and not the others. So I did another database and pull request to get all the data over again, but I'm pretty sure that isn't right.
<?php
require '../database.php';
$Code = null;
if ( !empty($_GET['Code'])) {
$Code = $_REQUEST['Code'];
}
if ( null==$Code ) {
header("Location: index.php");
} else {
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT Movies.Code, Title, Plot, Movies.Type, Movies.Category, Image, Score, Rated, Alt, Status, YearReleased, Duration, SUBSTRING(Duration, 1, CHAR_LENGTH(Duration) - 3) AS Duration2, TotalEps, Types.code as tcode, Types.Type as ttype, Categories.Code as ccode, Categories.Category as ca, Ratings.Code as rc, Ratings.Rating as rr, Genre, GenreCode FROM Movies, Types, Categories, Ratings, MovieGenres, Genres WHERE Movies.Type=Types.Code AND Movies.Rated=Ratings.Code AND Movies.Category=Categories.Code AND Movies.Code=MovieGenres.MovieCode AND MovieGenres.GenreCode=Genres.Code AND Movies.Code = ?";
$q = $pdo->prepare($sql);
$q->execute(array($Code));
$data = $q->fetch(PDO::FETCH_ASSOC);
Database::disconnect();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="description" content="">
<meta name="author" content="">
<title>MovieDB - <?php echo $data['Title'];?></title>
<!-- Bootstrap Core CSS -->
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="../css/modern-business.css" rel="stylesheet">
<link href="../css/custom.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="../font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<?php include '../include/nav.php';?>
<!-- Page Content -->
<div class="container">
<!-- Page Heading/Breadcrumbs -->
<div class="row">
<div class="col-lg-12">
<h2 class="page-header"><?php echo $data['Title'];?>
</h2>
</div>
</div>
<!-- /.row -->
<!-- Portfolio Item Row -->
<div class="row">
<div class="col-md-4">
<img class="img-responsive" src="../Images/<?php echo $data['Image'];?>" alt="">
</div>
<div class="col-md-8 hidden-sm hidden-xs">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Plot">Plot</a></li>
<li><a data-toggle="tab" href="#Details">Details</a></li>
</ul>
<div class="tab-content">
<div id="Plot" class="tab-pane fade in active">
<p><?php echo $data['Plot'];?></p>
</div>
<div id="Details" class="tab-pane fade">
<?php
echo'<li>Alternative Title: '. $data['Alt'] .'</li>';
echo'<li>Type: '. $data['ttype'] .'</li>';
echo'<li>Rated: '. $data['rr'] .'</li>';
echo'<li>Episodes: '. $data['TotalEps'] .'</li>';
echo'<li>Duration: '. $data['Duration2'] .'</li>';
echo'<li>Genre: ';
echo''. $data['Genre'] .'';
foreach($q as $data){
echo", ";
echo''. $data['Genre'] .'';
}
echo '</li>';
echo'<li>Status: '. $data['Status'] .'</li>';
echo'<li>Category: '. $data['ca'] .'</li>';
echo'<li>Year Released: '. $data['YearReleased'] .'</li>';
echo'<li>Score: '. $data['Score'] .'</li>';
?>
</div>
</div>
</div>
<div class="col-md-4 hidden-md hidden=-lg">
<h3>Plot</h3>
<p><?php echo $data['Plot'];?></p>
</div>
<div class="col-md-4 hidden-md hidden=-lg ">
<h3>Details</h3>
<ul>
<?php
$pdo = Database::connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "SELECT Movies.Code, Title, Plot, Movies.Type, Movies.Category, Image, Score, Rated, Alt, Status, YearReleased, Duration, SUBSTRING(Duration, 1, CHAR_LENGTH(Duration) - 3) AS Duration2, TotalEps, Types.code as tcode, Types.Type as ttype, Categories.Code as ccode, Categories.Category as ca, Ratings.Code as rc, Ratings.Rating as rr, Genre, GenreCode FROM Movies, Types, Categories, Ratings, MovieGenres, Genres WHERE Movies.Type=Types.Code AND Movies.Rated=Ratings.Code AND Movies.Category=Categories.Code AND Movies.Code=MovieGenres.MovieCode AND MovieGenres.GenreCode=Genres.Code AND Movies.Code = ?";
$q = $pdo->prepare($sql);
$q->execute(array($Code));
$data = $q->fetch(PDO::FETCH_ASSOC);
Database::disconnect();
echo'<li>Alternative Title: '. $data['Alt'] .'</li>';
echo'<li>Type: '. $data['ttype'] .'</li>';
echo'<li>Rated: '. $data['rr'] .'</li>';
echo'<li>Episodes: '. $data['TotalEps'] .'</li>';
echo'<li>Duration: '. $data['Duration2'] .'</li>';
echo'<li>Genre: ';
echo''. $data['Genre'] .'';
foreach($q as $data){
echo", ";
echo''. $data['Genre'] .'';
}
echo '</li>';
echo'<li>Status: '. $data['Status'] .'</li>';
echo'<li>Category: '. $data['ca'] .'</li>';
echo'<li>Year Released: '. $data['YearReleased'] .'</li>';
echo'<li>Score: '. $data['Score'] .'</li>';
?>
</ul>
</div>
</div>
<!-- /.row -->
<hr>
<!-- Footer -->
<?php include '../include/footer.php';?>
<!-- /.container -->
<!-- jQuery -->
<script src="../js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../js/bootstrap.min.js"></script>
</body>
</html>
formated:
SELECT Movies.Code, Title, Plot, Movies.Type, Movies.Category, Image, Score, Rated, Alt, Status, YearReleased, Duration, SUBSTRING(Duration, 1, CHAR_LENGTH(Duration) - 3) AS Duration2, TotalEps, Types.code as tcode, Types.Type as ttype, Categories.Code as ccode, Categories.Category as ca, Ratings.Code as rc, Ratings.Rating as rr, Genre, GenreCode
FROM Movies, Types, Categories, Ratings, MovieGenres, Genres
WHERE Movies.Type=Types.Code
AND Movies.Rated=Ratings.Code
AND Movies.Category=Categories.Code
AND Movies.Code=MovieGenres.MovieCode
AND MovieGenres.GenreCode=Genres.Code
AND Movies.Code = ?;
SELECT Genre, GenreCode
FROM MovieGenres, Genres
WHERE MovieGenres.GenreCode=Genres.Code
AND MovieCode = ?;
You aren't looping over the rows returned by the query.
Have a look at this answer https://stackoverflow.com/a/160365/6632744
You'll want something like this:
while ($row = $q->fetch(PDO::FETCH_ASSOC)) {
echo''. $row['Genre'] .'';
}
And you'll want to strip away your initial fetch.
$data = $q->fetch(PDO::FETCH_ASSOC); // remove this line
I'm making a script that i use my database to show the menu of a page. But i ran into a problem...
The script on my website. : Click here
Problem
So i have this code
UPDATED CODE AND ADDED LINK
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Heroic Features - Start Bootstrap Template</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/heroic-features.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Start Bootstrap</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<?php
$db = new mysqli('xxxxxxxxxxx');
if($db->connect_errno > 0){
die('Unable to connect to database [' . $db->connect_error . ']');
}
if($_GET['action'] == '')
{
$sql = "SELECT * FROM li_psp";
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
while($row = $result->fetch_assoc()){
echo " <li>
<a href='{$row['li_href']}'>{$row['li_label']}</a>
</li>";
}
}
?>
<?php
$db = new mysqli('xxxxxxxxxxx');
if($db->connect_errno > 0){
die('Unable to connect to database [' . $db->connect_error . ']');
}
if($_GET['action'] == '')
{
$sql = "SELECT * FROM ul_psp";
error_reporting(E_ALL);
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
while($row = $result->fetch_assoc()){
echo "<li class='dropdown'>
<a href='#' class='dropdown-toggle' data-toggle='dropdown'>{$row['ul_name']} <b class='caret'></b></a>
<ul class='dropdown-menu'>";
if($_GET['action'] == '')
{
$sql = "SELECT * FROM ul_data_psp WHERE belong_to = {$row['ul_name']}";
if(!$result = $db->query($sql)){
die('There was an error running the query [' . $db->error . ']');
}
while($row = $result->fetch_assoc()){
echo " <li>
<a href='{$row['ul_data_href']}'>{$row['ul_data_label']}</a>
</li>";
echo "</ul>
</li>";
}
}
}
}
?>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
But for some reason it does not work. I get this error: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/u799303375/public_html/beta/include/menu.php on line 98
What have i tried?
I tried changing all the " to ' but it didn't work, i need help fixing this code, if you have any other things i can do better please tell it! Thanks!
You have malformed quotationmarks. Put variables not directly into strings, concat them with a .:
echo '<li><a href=' . $row['ul_data_href'] . '>' . $row['ul_data_label'] . '</a></li>'