How to do this?

Discussion in 'Off Topic' started by rbxlmadx, Apr 15, 2015.

  1. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    So let's say I have a link, example: http://www.google.com/index.php?Ads=12

    (Not a real Lin, just for example), anyway, you see that twelve at the end? I want that twelve (the numeral) to be the thing I fetch from a table... So it would look like this in script:

    http://www.google.com/index.php?Ads='$numbertwelve'

    !!!!But!!!! I do not know how to fetch from a table so I simply can not make this happen, please someone, how can I fetch from a table so this function will work?
     
  2. Dead-i

    Dead-i x10Hosting Support Ninja Community Support

    Messages:
    6,084
    Likes Received:
    367
    Trophy Points:
    83
    Hi rbxlmadx,

    In this situation, you could have a MySQL table containing all the data required. Then, you could retrieve the value of "ads" by using $_GET['ads'] in PHP, and pull the appropriate record from MySQL. ;)

    Thank you,
     
  3. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    Can you give me an example?
     
  4. leafypiggy

    leafypiggy Manager of Pens and Office Supplies Staff Member

    Messages:
    3,819
    Likes Received:
    163
    Trophy Points:
    63
    Code:
    
    $id = $_GET['ads'];
    
    //SANITIZE $id, and do something with it (call MySQL with PDO, etc)
    
    That's pretty much all it is. How you're getting the records depends on a ton of factors.

    Moved to Scripts & Third Party Applications
     

Share This Page