Help with this? It is confusing to me...

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

  1. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
    So here we have this script:

    $result = mysql_query("SELECT Users FROM days WHERE ID = '1'");
    while ($row = mysql_fetch_object($result)) {
    echo "<center>$row->Users</center>";
    }


    $row->Users shows the amount of users which is 0 when I am on my homepage, so that works, but now, I want to insert that $row->Users into a img url, like this:

    <img src='http://www.example.com/e?e='$row->Users''>

    Now I obviously know that when I am putting it in the link that it should look something like that. Anyway, I don't know how to do it, it gives me an error everytime...
     
  2. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
  3. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
  4. andylpsx

    andylpsx New Member

    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    3
    Since this is PHP HTML doesn't render the code in and instead your URL would be http://www.example.com/e?e=$row->user try using something like:

    Code:
    <?php
    
    echo "<img src='htttp://www.example.com/e?e=" .  $row->Users . "' >";
    ?>
    Tell me if this works.
     
    Last edited: Apr 20, 2015
    • Like Like x 1
  5. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8
  6. andylpsx

    andylpsx New Member

    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    3
    Did that work for you?
     
  7. rbxlmadx

    rbxlmadx Member

    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    8

Share This Page