SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2012
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New to PHP, trying to create table that order themselves

    Hey Guys,

    I am new to this forum and started learning PHP and SQL. I recently bought a book and started learning it because I wanted to use it for my website.

    My main goal is to create a table with links that can be order by most viewed, best rated etc. (like when you type in a product on ebay and can then sort the results by best match price etc.)

    So my question is if this is possible just by using PHP and SQL and how advanced is this concept (can i implement this after reading one book on sql and php?).
    An additional question is if it is possible to implement a rating system for the different links in my database and how advanced that concept is. (with rating system i mean a simple 'like or dislike' system, and i would hope that my data base can calculate a percentage or likes to dislike.)

    Thx all!

  2. #2
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To do this, you would need to have to order the SQL results based on which the user selects, eg: if they select name, you would need to user
    Code:
    ORDER BY name
    . To get the various selections, just have a link with a get variable.

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    69 Post(s)
    Tagged
    0 Thread(s)
    Welcome to SitePoint

    As Works says, the brunt of this task lies on SQL's shoulders; the PHP side of things can be relatively simple; You just need to figure out what you want to be order-able and then make sure your database has the means to do so.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


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
  •