Issue
I'm trying to return a row from my database however, when I replace the page='url'
with $filePath = $_SERVER["REQUEST_URI"]; page='.$filePath.'
it returns nothing.
I'm assuming the answer is simple however, I can't see to find the solution.
Full Code
$filePath = $_SERVER["REQUEST_URI"];
$query = "SELECT * FROM Meta WHERE page=' . $filePath . '";
$result = mysqli_query($connection, $query);
while ($row = mysqli_fetch_assoc($result)) { ?>
<title><?php echo $row["title"]; ?></title>
<?php } ?>
Solution
try the query like this
$query = "SELECT * FROM Meta WHERE page = '" . $filePath . "' ";
Answered By - samehanwar
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.