Page 2 of 2 FirstFirst 12
Results 11 to 11 of 11

Thread: displaying images dynamically

  1. #11
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    you could repeat the mt_rand for as many times as you would like, just make sure that each one has a different variable. For example

    PHP Code:
    <?
    $image1 
    mt_rand(1,7);
    $image2 mt_rand(1,7);

    $sql1 "SELECT * FROM `images` WHERE `store`='store1' AND `id`='$image1'";

    $sql2 "SELECT * FROM `images` WHERE `store`='store2' AND `id`='$image2'";

    //Then simply execute the sql queries and change to appropriate numbers.
    ?>
    Enjoy!
    Last edited by thetestingsite; 09-06-2006 at 04:54 PM.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

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