Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Comments section when PHP generates page

Featured Replies

Hi guys!

 

I need to code a comments section for the games on my website. I know how to do this, however, I'm not sure how to make comments specific to the PHP generated id page. Here is a link so you can get the full picture...

 

The Site

 

In terms of the Database...

 

Table Name: comments

Columns: comment_id, comment

 

Any advice would be great! :)

 

Matt

Hi guys!

 

I need to code a comments section for the games on my website. I know how to do this, however, I'm not sure how to make comments specific to the PHP generated id page. Here is a link so you can get the full picture...

 

The Site

 

In terms of the Database...

 

Table Name: comments

Columns: comment_id, comment

 

Any advice would be great! :)

 

Matt

simple create a field in your comments table that says pid for page id, then every time u write a comment on a certain page insert the page id u have at the top in your url which i assume is id=2, then you can display comments like this specific to each page

 

$id = (isset($_GET['id'])) ? mysql_real_escape_string($_GET['id']);
$comment_select = mysql_query("SELECT * FROM `comments` WHERE `pid` = '$id'")

  • Author

Thanks for the reply! Worked well! I'm new to PHP, so learning all the time!

 

Matt

Thanks for the reply! Worked well! I'm new to PHP, so learning all the time!

 

Matt

Np btw this line $id = (isset($_GET['id'])) ? mysql_real_escape_string($_GET['id']);

 

should be

$id = (isset($_GET['id'])) ? mysql_real_escape_string($_GET['id']) : false;

was rushing when i wrote it haha

Thanks for the reply! Worked well! I'm new to PHP, so learning all the time!

 

Matt

btw personally i'd wrap each comment in a border and make the color black maybe and not bold, its hard to tell there comments

  • Author

Okay, thanks for the advice guys! It's for a project I'm doing; pretty much finished now!

 

Matt

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.