Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 2 of 2

Thread: php help

  1. #1
    Join Date
    Oct 2005
    Location
    Corby
    Posts
    5,512
    Tokens
    2,675
    Habbo
    cabbage (origins)

    Latest Awards:

    Default php help

    Why does this just display the name of the rare rather then the picture

    PHP Code:
    function displayRares($type$limit) {
        
    $raresQuery mysql_query("SELECT * FROM `rares` WHERE type='$type' LIMIT $limit");
        echo 
    "<table border='0'>";
        while (
    $rows mysql_fetch_array($raresQuery)) {
        echo 
    "<tr>";
        echo 
    "<td>";
        if (!empty(
    $rows['url'])) { echo("<img src=\"" $rows['url'] . "\" alt=\"" $rows['name'] . "\".gif />"); }
        echo 
    "</td><td>";
        if  (!empty(
    $rows['name'])) { echo($rows['name']); }
        echo 
    "</td>";
        if (!empty(
    $rows['t'])) { echo("<td>" $rows['t'] . "T</td>"); }
        if (!empty(
    $rows['hc'])) { echo("<td>" $rows['hc'] . "HC</td>"); }
        if (!empty(
    $rows['rd'])) { echo("<td>" $rows['rd'] . "RD</td>"); }
        echo 
    "</tr>";
        }
        echo 
    '</table>';
        } 
    no

  2. #2

    Default

    Well that owuld be because you have put the extention after the alt, so it's not grabbing the image properly..
    PHP Code:
    function displayRares($type$limit) {
        
    $raresQuery mysql_query("SELECT * FROM `rares` WHERE type='$type' LIMIT $limit");
        echo 
    "<table border='0'>";
        while (
    $rows mysql_fetch_array($raresQuery)) {
        echo 
    "<tr>";
        echo 
    "<td>";
        if (!empty(
    $rows['url'])) { echo("<img src=\"" $rows['url'] . ".gif \" alt=\"" $rows['name'] . "\" />"); }
        echo 
    "</td><td>";
        if  (!empty(
    $rows['name'])) { echo($rows['name']); }
        echo 
    "</td>";
        if (!empty(
    $rows['t'])) { echo("<td>" $rows['t'] . "T</td>"); }
        if (!empty(
    $rows['hc'])) { echo("<td>" $rows['hc'] . "HC</td>"); }
        if (!empty(
    $rows['rd'])) { echo("<td>" $rows['rd'] . "RD</td>"); }
        echo 
    "</tr>";
        }
        echo 
    '</table>';
        } 
    Try that..

Posting Permissions

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