Mihalism Help needed :)

Discussion in 'PHP' started by exonmedia, Apr 23, 2009.

  1. #1
    Hi,

    any one know how you add random image on the right side of the viewer ?

    Same as on this site

    Thanks :)
     
    exonmedia, Apr 23, 2009 IP
  2. Stylesofts

    Stylesofts Peon

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey,

    Seems that you are having trouble wid this script..Well here it goes..
    Cheers
    i hope u have croped the images...if not plz put the dimensions on the image as per your desired width
    
    ////////////////////////it shows random 4 images///////////
    ///////////$imageLeftId is the image id which appears on the left/////
    $selectQuery = "SELECT id,imageName FROM tbl_picture WHERE id='$imageLeftId' ORDER BY rand() LIMIT 4";
    $resultQuery = mysql_query($selectQuery);
    $numRowsQuery = @mysql_num_rows($resultQuery);
    if($numRowsQuery > 0)
    {
    while($rowQuery = @mysql_fetch_array($resultQuery))
    {
    $imageName = $rowQuery['imageName'];
    $path = "here goes the location of the image".$imageName;
    ?>
    <div>
    <?php
    if(file_exists($path) && $imageName!='')
    {
    echo("<img src='$path'>");
    }
    else
    {
    echo("No image");
    }
    ?>
    </div>
    <?php
    }
    }
    ?>
    
    PHP:

    Regards,
    Stylesofts Developing Team
     
    Stylesofts, Apr 24, 2009 IP
  3. GMC

    GMC Member

    Messages:
    99
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #3
    Hi Stylesofts - I have jumped in here cause I thought it would be good

    I have tried adding your code to the viewer.php and the viewer.tpl (That was a reach - lol)

    and I get parse errors

    can you help me insert this into the right file and the right place

    Thanks in advance

    GMC
     
    GMC, May 6, 2009 IP