Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="#"><button onclick="#" style="#">Like</button></a>
- <?php
- $dbhost = 'localhost';
- $dbuser = 'root';
- $dbpass = '';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass);
- if(! $conn )
- {
- die('Could not connect: ' . mysql_error());
- }
- $currentID = mysql_real_escape_string($_GET['id']);
- $sql="SELECT comment, userCreated, threadsID FROM comments WHERE threadsID=".$currentID;
- #Where my likes column in my DB is
- $likes = "SELECT likes WHERE threadsID=".$currentID;
- $numrows = mysql_num_rows($sql);
- mysql_select_db('comments');
- $retval = mysql_query( $sql, $conn );
- if(! $retval )
- {
- die('Could not get data: ' . mysql_error());
- }
- while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
- {
- $userCreated = $row['userCreated'];
- $comment = $row['comment'];
- echo "<div class='comment'>$userCreated:<br>$comment</div><br>";
- #echo $userCreated." said<br>".$comment."<br>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement