Show comment message from the database - PHP tutorial

preview_player
Показать описание
Show comment message from the database - Learn PHP backend programming. Today we will display the comments we uploaded in the previous episode.

--

mmtuts is a YouTube channel that focuses on teaching beginner and advanced courses in various multimedia related skills.
We plan to make tutorials available on programming, video production, animation, graphic design, and on software such as the Adobe Creative Cloud programs.

PHP for beginners is a how to series that teaches the PHP coding language to people who are just starting out learning programming. The course teaches how PHP scripting can be made easy and teaches how to build many apps such as a login system, a comment section, how to upload images, how to create users in a website, and much more. Creating dynamic websites with PHP is easy and should not be seen as otherwise, which is why we want to explain the language in a easy to understand way for beginners.

If you have suggestions on new courses, or specific lessons within existing courses you would like to see, then feel welcome to submit them in the comment section or in a private message. ALL suggestions will be seen, but not all will be replied to since we get quite a few every day.
Рекомендации по теме
Комментарии
Автор

I didn't know what php was only a few weeks ago and I wanted to make a site where multiple user makes multiple inputs and they get result after "computer" analyze and returns it. "Computer" would be a server, now I know. What I learned from your tutorial taught it can be done with php and I got quite happy today. Thanks.

turboromy
Автор

I want to thank you for the tutorial, my client wanted to add a comment system last minute to his website and this helped alot. However, now he wants to add a reply option to the comments that are posted. I wanted to know how I will be able to do that since I didnt see that option in the tutorial. thank you again for your help.

robertbeauchamp
Автор

I've been searching for this sooo long, thanks for your awesome tutorials and explanation!!
it seems like there are a very low ammount of php tutorials in comparison to other programming languages

SoccerEFM
Автор

I love your tutorials.. thank you very much.!. you're really great.. God Bless you.. :)

nelsirc
Автор

Thank you so much mtuts. I love your work... Well explained

cyronadebz
Автор

Hey mmtuts, great video and it's helped me out quite a lot. So I'm trying to comment on various articles. So each comment has to relate to the specific article it's intended for. All articles are in db. My comments table has the articleID as well as comment, id, user. The problem I have is that I only seem to able to output the last comment submitted. Previous comments stay in db but only last one displays. Not sure if I have to do INNER JOIN or something? Any suggestions would be great. Thanks. Andy.

diyandy
Автор

mmtuts, when ever I refresh my page it copy's my previews comment and pastes it so it creates a clone and in the data base aswell, help please.

crocsocial
Автор

Where's the next tutorial video after this video?

juancarlosdomingo
Автор

Hey, iknow I´m really late to ask a question, but maby it will work :) i love you tutorial and everthing worked fine until the very last step:
despite the use of nl2br (and also nl2br(stripslashes) and nl2br(stripcslashes), the comments shown on the website exceeds the white text box. Only of i press Enter while writing the comment, it works. Do you have any idea what i did wrong?

annaheilos
Автор

easy and nice explanation! thank you!
the only thing is missing I believe is when we comment it should get the new comments on top and older comments below.. (the order of comments should be new to older)

pilotflyingapp
Автор

Nice one. Works really well. Keep up the work buddy.

chrisjacobs
Автор

At 4:00, you wrote

$row = $result->fetch_assoc();

Is that good or should it be changed to

$row = mysqli_fetch_assoc($result);

like we have in the other tutorials?

diviiniity
Автор

Hiya mate, me again. Just wondering how I get it to post the users name with the comment as right now it post the work 'uid' not sure if i messed up somewhere. Thanks again for the tutorials

daz
Автор

I am learning a lot with your videos thanks man !

eliottdonatien
Автор

Thanks so much mate!! nice tutorial, really helped a lot

MehediHasan-ziyg
Автор

Hey buddy is this on the background or we need to refresh the page to display it

mackynikat
Автор

sir??
can i have a question? why does my database comments go beyond the comment-box??

johnmartininfante
Автор

Notice: Undefined variable: result in on line 16
Fatal error: Call to a member function fetch_assoc() on null in on line 16

thats the error I am getting after i got the typo corrected, right now the getComments function is this

unction getComments($conn){
$sql = "SELECT * FROM comments ORDER BY cid DECS";
$results = $conn->query($sql);
$row = $result->fetch_assoc();
echo $row['message'];
}

also can you help in regards on how to stop the duplication of entries if and when i refresh the page, I did go through the comments below to check if others were facing the same issue, but was not able to understand how they solved it.

Thanks !!

cyrisful
Автор

How Am I able to make the newest comments first?

Some_Techie
Автор

when i change the order of these 2 functions i get Call to undefined function getComments() error but there is nothing to cause this error between 2 functions

can
visit shbcf.ru