Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2002
    Location
    UK
    Posts
    837

    PHP/MYsql Question

    Hi all

    Im just currently working on a database programme at the moment for my website

    few things im unsure about maybe someoen could help?

    - My database has the following fields

    -product id, prod description,link,status,effective from,effective to, no of acesses

    Right what im trying to do is acheive the following:

    - In the link field say i put in the link of "http://www.google.com" now when i retrive this information on the webpage it does not come up as a clickable link.. How do i fix this problem?anything specific i have to do?

    - on the right hand column i have something called "top 10" what this does is retrive and displays the top 10 clicked prodcuts..any idea on how to set this up?

    Thanks
    bye for now
    s

  2. #2
    Join Date
    May 2002
    Location
    Alkmaar, Netherlands
    Posts
    78
    1. goto hotscripts.com
    2. download few php scripts that sounds same as you want to do
    3. look at their code

    good luck
    Gokhan Arli
    Web Developer(RubyOnRails/MySQL/.NET)
    www.sylow.net

  3. #3

    erm

    u need to set the address up as a link, it doesn't automatically detect it so:
    <a href="$address">$address</a>

    $address is whatever the variable is set up as, i presume u could do it like this anyway, am still only learning php.

    i dunno bout other one, somehow make it so it shows the products which have been sold the most amount of times maybe using COUNT statement then somehow show the top 10 in order???

  4. #4
    use the following select statement:

    select * from TABLENAME order by noofaccesses DESC limit 10
    Nico V.
    KazaaSkins.Com - Now online!

  5. #5
    Originally posted by NicoV
    use the following select statement:

    select * from TABLENAME order by noofaccesses DESC limit 10
    -- Editted --

  6. #6
    Join Date
    Dec 2002
    Location
    UK
    Posts
    837
    Hi

    got the answer the link question:

    <td><a href="<?php echo $row_Recordset1 ['link']; ?>" target="_blank">Link</a></font></td>


    finalyl clocked it

    with regards to the counter thingy

    does the Field numberof access has to be set up in anyway on the table?

    sajid

  7. #7
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    No, you can have whatever fields you like in your table.

  8. #8
    Join Date
    Dec 2002
    Location
    UK
    Posts
    837
    Right thanks for that

    what ive done is created a new Field called Counter and set its type to be BIGINT and its value is all set at 0

    i have this Table called "product_title" which shows all the titles of the products i have e.g printer,scanner, and whatever else

    When each Product link is clicked it takes u to the product page..on that page has its description and all that stuff on it

    Basically each product has its own counters..what needs to be done possibly that each time a page is clicked..the counter is updated..

    the product with most hits will appear in the top 10 most hits..

    how do i start this do u need some sort of update query?

    thanks
    saj

  9. #9
    Join Date
    Dec 2002
    Location
    UK
    Posts
    837
    any takes on this?

    thanks
    s

  10. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

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