SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Associating a number with each row returned

    Users on my website can post testimonials about their experiences with essential oils. Sometimes a user will post more than one testimonial in one day. The meta-description of each page is dynamically generated using this format:

    Bill Jone's testimonial regarding essential oils was posted on 05-14-2006 and is one of thousands in the searchable database.

    The problem here is that Google Webmaster Tools is reporting that it doesn't like to see multiple pages using the same meta-description. So I would like to come up with a remedy that counts how many testimonials a user has submitted and then word the meta-description like this:

    Bill Jone's first testimonial regarding essential oils was posted on 05-14-2006 and is one of thousands in the searchable database.
    Bill Jone's second testimonial regarding essential oils was posted on 05-14-2006 and is one of thousands in the searchable database.
    Bill Jone's third testimonial regarding essential oils was posted on 05-14-2006 and is one of thousands in the searchable database.

    The problem is, I don't even know the best way to do this using mySQL. Any suggestions?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    you'll need to add a counter (integer column) to the testimonials table

    and you'll need to update this using application code (php or whatever) when you add a testimonial
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ok, I can see how your idea could be handy for all future testimonials that are posted. But what about the 6,000+ that are already in the DB?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,216
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by busboy View Post
    But what about the 6,000+ that are already in the DB?
    you would modify the logic slightly and run it against the database to assign those numbers through the application -- perhaps using a cursor (in a one-shot update)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •