close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Display page comments on seperate pages

Thread began 2/01/2010 6:05 pm by ijk76319396 | Last modified 2/02/2010 12:29 pm by Jason Byrnes | 711 views | 1 replies |

ijk76319396

Display page comments on seperate pages

I want to display my page comments with the page the user is commenting on only, right now I have it set up so it displays on every page in the recordset. The way I plan on filtering is by having the date under the comic page being entered into the database, in the comments table, then I want to filter it by the creators ID (this works) and the date entered which will be identical to the exact time the page was uploaded shown in the date field below the comic.

I am trying to write the proper query where comments.date = uploads.date , right now I am getting zero results. The query I wrote looks like

SELECT comments.*, uploads.date
FROM comments, uploads
WHERE USERIDENT = colname AND comments.date=uploads.date
ORDER BY comments.ID DESC



Examples can be seen at web_comicX.php?ID=6
and web_comic.php?ID=6

The first one has the database query above, the second one works but with the comments on every page.

Sign in to reply to this post

Jason ByrnesWebAssist

are you positive that there are results in the database for the USERIDENT you are testing where the comments.date = uploads.date?


I find it helpfull when troubel shooting SQL Queries to take the web page out of the mix and go do the query right in the database. If you have a local database, use a tool like the MySQL GUI Tools query browser or SQLYog to access the database and run the query.


first try with just the date aspect:
SELECT comments.*, uploads.date
FROM comments, uploads
WHERE comments.date=uploads.date


see if this returns a result, if so make note of one of the USERIDENT values and try the query with one of those values:
SELECT comments.*, uploads.date
FROM comments, uploads
WHERE USERIDENT = <value from precious query> AND comments.date=uploads.date


if the first query does not return a result, double check the values being stored in the comments.date and uploads.date columns.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...