confusio Posted July 5, 2007 Share Posted July 5, 2007 Hi, I have a small html site where I write reviews of books I've read and I am try to find a way to keep a track of the number of reviews by genre (horror,crime). Is there a way that i can insert a php script into each html table (each review is in a table box) so I can later display at the top of the genre page "There is ... reviews in this section." ? And if thats possible, would it be possible to display the total amount of reviews in the whole site like "We have read a total of ... books." ? Sorry I'm a total php newbie, only good with html. Thanks for your help, Mark Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 yes and yes just add the php declaration <? stament here ?> Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 5, 2007 Share Posted July 5, 2007 Yes, but you are going to have to set up a database to store all the information in. You can set up a table like this: TABLE 'books' --------------- bookID title author genre review Obviously you can add whatever you want to that list. Is this a place where only you are making one review per book? Or can their be multiple reviews on a book? If there can be multiple reviews, you will have to setup a table for that, and remove the "review" field on the previous table. TABLE 'reviews' ------------------- reviewID bookID review reviewer <----person who made the review Once you have all that information stored, it will be simple to display any data you would like. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 Hi, I have a small html site where I write reviews of books I've read and I am try to find a way to keep a track of the number of reviews by genre (horror,crime). Is there a way that i can insert a php script into each html table (each review is in a table box) so I can later display at the top of the genre page "There is ... reviews in this section." ? And if thats possible, would it be possible to display the total amount of reviews in the whole site like "We have read a total of ... books." ? Sorry I'm a total php newbie, only good with html. Thanks for your help, Mark Yes, but you are going to have to set up a database to store all the information in. You can set up a table like this: TABLE 'books' --------------- bookID title author genre review Obviously you can add whatever you want to that list. Is this a place where only you are making one review per book? Or can their be multiple reviews on a book? If there can be multiple reviews, you will have to setup a table for that, and remove the "review" field on the previous table. TABLE 'reviews' ------------------- reviewID bookID review reviewer <----person who made the review Once you have all that information stored, it will be simple to display any data you would like. connect it ??? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 5, 2007 Share Posted July 5, 2007 teng84 - Huh? Did my response kinda sound off topic? I am try to find a way to keep a track of the number of reviews by genre (horror,crime). They are obviously going to need a database to dynamically get that information and easily display it. Although I guess that is not the only route you can take. Now I am confused...am I way off track here? Your explanation isn't making sense either... <? stament here ?> What does that have anything to do with what they asked? Of course to use PHP it needs to be between those tags, but that wasn't their question...they need help on figuring out how to implement what they are trying to do. Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 Is there a way that i can insert a php script into each html table (each review is in a table box) so I can later display at the top of the genre page "There is ... reviews in this section." ? Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 5, 2007 Share Posted July 5, 2007 i dont see question for db sorry Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 5, 2007 Share Posted July 5, 2007 Yes, but to be able to insert information like that, they are going to need somewhere to get that information. Telling them they need to use php tags isn't going to get them anywhere, they need help figuring out how to implement the idea. I will just wait until they reply and give more of an explanation, because clearly we aren't understanding the question. Quote Link to comment Share on other sites More sharing options...
Barand Posted July 5, 2007 Share Posted July 5, 2007 Putting php code into an existing .html file is not going to work. Needs to be a .php file to be processed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.