greenway Posted November 7, 2006 Share Posted November 7, 2006 Hi eveeryone newb here ;)I am using jocka's post comment script and have hit a problem.This is part of the code I am using:[code]<?$page_id = "6"; // for exampleinclude("comments/comments_show.php");include("comments/comments_form.php");?>[/code]Now the problem I have is my pages is are posts with an id like: /view.php?ItemID=1 /view.php?ItemID=2I understand that if the pages where static html I could just call each page page_id = "6" "7" ect.but because each user post is inserted in to the database I dont know what the page ID will be.I have got the script working except all comments are being shown for each ItemID=So if there are 10 comments in total in the database on 10 different topics each page is showing all 10. Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/ Share on other sites More sharing options...
xtentic Posted November 7, 2006 Share Posted November 7, 2006 If you use MySQL as the database you will get the ID with MYSQL_INSERT_ID() :) Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/#findComment-120943 Share on other sites More sharing options...
greenway Posted November 7, 2006 Author Share Posted November 7, 2006 Thanks for the tip,I found this on the mysql website after reading your comment.[color=red]Parameterslink_identifier The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed.[/color]Is that it ? Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/#findComment-120953 Share on other sites More sharing options...
trq Posted November 7, 2006 Share Posted November 7, 2006 Im sorry, but the description of your problem is not AT ALL clear. Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/#findComment-120959 Share on other sites More sharing options...
greenway Posted November 7, 2006 Author Share Posted November 7, 2006 Sorry thorpe I agree,I am finding it hard to explain.I will try and explain it better. Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/#findComment-120961 Share on other sites More sharing options...
greenway Posted November 8, 2006 Author Share Posted November 8, 2006 I have a website that members post stories on.I have put up a comment script for replies.Part of the code for the replies is: [code]<?$page_id = "6"; // for exampleinclude("comments/comments_show.php");include("comments/comments_form.php");?>[/code]From my limited knowledge the help file with the script says to change the page_id to the page number of the post the person is replying to.Problem is the original posts are being stored in a database with page titles like: mystoryItemID=1What I want to be able to do is store each comment with the same page ID so comments are only shown in reply for that story.This is the script I am using:[url=http://www.digitalmidget.com/php_noob/comment.php]http://www.digitalmidget.com/php_noob/comment.php[/url] Link to comment https://forums.phpfreaks.com/topic/26440-help-with-jockas-comment-script-please/#findComment-121488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.