-
-
Save CharlesCraft50/6e69cfa22398a6539eb0be707c232865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('database.php'); | |
$searchByOrder = $_REQUEST["SubjectNamePostsOrderBy"]; | |
if($searchBy = $conn->prepare("SELECT * FROM PostData WHERE SubjectName LIKE ? ORDER BY " . $searchByOrder . "")) { | |
$searchLikeBy = "%" . $_REQUEST["SubjectNamePostsLike"] . "%"; | |
$searchBy->bind_param('s', $searchLikeBy); | |
$searchBy->execute(); | |
$searchBy->bind_result($Id, $UserName, $SubjectName, $PostDataPost, $MainImage, $DatePosted, $PostViews, $UpVoted, $DownVoted); | |
while($searchBy->fetch()) { | |
echo "<pre style=\"background-color: #fafafa; border-left: 3px solid #333;\"><a href=\"?SubjectName=" . $SubjectName . "\"><h3>" . $SubjectName . "</h3></a><p style=\"font-size: 13px; display: inline; color: #9197a3;\">User Posted: " . $UserName . " </p><p style=\"font-size: 13px; display: inline; color: #9197a3;\">Date Posted: " . $DatePosted . " </p><div id=\"descArea\"><br>" . $PostDataPost . "</div><br>" . "<img src=\"" . $MainImage . "\" style=\"max-width: 500px; max-height: 500px;\"></img><img src=\"DownVoted-Icon.png\" width=\"30\" height=\"30\"></img> " . $DownVoted . "<br><div style=\"font-size: 13px; display: inline; color: #9197a3;\">Views: " . $PostViews . "</div></pre><p style=\"border: 1px solid transparent; border-bottom: 1px solid black; \"></p>"; | |
} | |
} else { | |
echo "Problem Loading Index Post Data! Error: " . $conn->error; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment