Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "username";
- $password = "";
- $dbname = "dbname";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT comment_txt, name, comment_date FROM mytablename where productcomment_increment_id='$productId' && comment_status='Approved'";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- echo "<i><b>Author Name:</b></i>";
- echo $row["name"];
- echo "<br /><i><b> Comment: </i></b>";
- echo $row["comment_txt"];
- echo "<br /><i><b>Date: </i></b>";
- echo $row["comment_date"];
- echo "<br><br>";
- }
- } else {
- //echo "0 results";
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement