Jump to content

Is there a way...


confusio

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ???

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.