This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Having a Recent comment Section
#1

Is there a way to pull the comments from the DB in to a separate section of the site. as the user post a comment on the site in any section the recent comment section gets up dated and where or what they comments on ? i am never to php is there anyone that can help ,me?

therealdaveharevy
Reply
#2

Hi,

You could experiment with this. You will need to replace "localhost", "mysql_user", "mysql_password" and "database" with the correct values.
PHP Code:
<?php
$link
= mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);

$result = mysql_query("SELECT * FROM comments WHERE is_approved = '1' ORDER BY dated DESC LIMIT 5", $link);

while (
$comments = mysql_fetch_assoc($result)) {
echo
$comments["comment"];
echo
"<p />";
}
?>

Have you completed the interview?
Reply
#3

thanks alot sir, I will give it a try and let you know how it turns out Smile
-
Dave Harvey
Reply
#4

Is there a way to know here the user commented to and link to the comment like this example www.topmmanews.com? this is what i am trying to achieve.
Reply
#5

An add-on is now available for this:
http://www.commentics.org/add-ons.php#recent_comments

Have you completed the interview?
Reply
#6

(24-Aug-2011, 07:30 PM)Steven Wrote:  An add-on is now available for this:
http://www.commentics.org/add-ons.php#recent_comments

Hi I have downloaded the Add On but I just have one security question.

In order to implement the code The Database information has to bee entered, including the password etc. Doesn't that mean that anyone looking at my source code will know all the details to access my database etc?

Thanks



If at first you don't succeed then so much for parachuting!
Reply
#7

Hi,

The database information is entered using PHP, which is a server-side programming language, so it won't be displayed in the client-side source code.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
13-Aug-2020, 12:36 PM
Last Post by Steven
01-Jan-2016, 12:26 AM
Last Post by infogate
03-Feb-2015, 09:23 PM
Last Post by Tom C.
15-Apr-2013, 05:41 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)