Created
April 19, 2016 14:51
-
-
Save CharlesCraft50/417f51aac6fd1fe6ac30687781688b15 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'); | |
$SName = $_GET['SubjecName']; | |
$CLimit = $_GET['cmtsLimit']; | |
$getCmts = $conn->prepare("SELECT * FROM PostComments WHERE SubjecName = ? ORDER BY DatePosted DESC LIMIT " . ((int)$CLimit) . ""); | |
$getCmts->bind_param('s', $SName); | |
$getCmts->execute(); | |
$getCmts->bind_result($Id, $Name, $Comment, $DatePosted); | |
while($getCmts->fetch()) { | |
echo "<pre style=\"background-color: #fafafa; padding: 0px;\">"; | |
echo "<p name=\"" . $Id . "\">Id: " . $Id . " User: <b>" . $Name . "</b>" . " Comment Date: " . $DatePosted . "</p>"; | |
echo $Comment; | |
echo "<a name=\"" . $Id . "\"></a>"; | |
echo "</pre>"; | |
} | |
$conn->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment