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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: [Help] PHP/SQL

  1. #1
    Join Date
    Jan 2007
    Location
    Wales
    Posts
    2,432
    Tokens
    141

    Latest Awards:

    Default [Help] PHP/SQL

    Hello, I'm in need of help again. I have been coding a couple of scripts in PHP using SQL databases. One of them is a photo album script.

    Some of the script:

    PHP Code:
    <? $getphotos mysql_query("SELECT * FROM photos WHERE albumid = '$albumid3' ORDER BY 'photoid' ASC");
    while(
    $photos mysql_fetch_array($getphotos)) {
    echo 
    "$photoname - $photodesc<br /><br /><img src='$photoloca'><br /><br />";
    }
    ?>
    This shows all of the photos that the user has in that album, I need it so it only shows one photo at a time, then you can press next and it shows the next photo and go through all the photos in the album.

    Any help appreciated, +rep if I can.

    Thank you very much,
    Vince.
    Free Online Games And Videos:
    http://www.vincesgames.com



  2. #2
    Join Date
    Dec 2009
    Posts
    1
    Tokens
    0

    Default Try this!

    Hi there!
    Try a dynamic solution with PHP's $_GET function.
    I havent tested this but it should work.

    In the URL (example): mydynamicalbum.com/index.php?imagenumber=2

    Then run a query wich wil post the image with ID 2.
    The link can be created dynamicly by adding +1 to the imageID you are already visiting.

    Good luck

  3. #3
    Join Date
    Jan 2007
    Location
    Wales
    Posts
    2,432
    Tokens
    141

    Latest Awards:

    Default

    Quote Originally Posted by Kristianw View Post
    Hi there!
    Try a dynamic solution with PHP's $_GET function.
    I havent tested this but it should work.

    In the URL (example): mydynamicalbum.com/index.php?imagenumber=2

    Then run a query wich wil post the image with ID 2.
    The link can be created dynamicly by adding +1 to the imageID you are already visiting.

    Good luck
    Thanks, but I don't think this fixes my problem just yet. I'll give you another example. I have a script that displays a user's friends, but I only want it to display 4 of all their friends, like it does on facebook and bebo for example, any idea how I could do this? +Rep
    Free Online Games And Videos:
    http://www.vincesgames.com



  4. #4
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    mysql_query("SELECT * FROM `friends` WHERE `friend`='$username' LIMIT 4");

    Hope that helped.

    Lew.
    Im not here to be loved, I love to be hated :-}


  5. #5
    Join Date
    Jan 2007
    Location
    Wales
    Posts
    2,432
    Tokens
    141

    Latest Awards:

    Default

    Quote Originally Posted by Lewiie15 View Post
    mysql_query("SELECT * FROM `friends` WHERE `friend`='$username' LIMIT 4");

    Hope that helped.

    Lew.
    That's done it, thanks a lot! +Rep if I can.
    Free Online Games And Videos:
    http://www.vincesgames.com



  6. #6
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    No probs, next time google XD

    Lew.
    Im not here to be loved, I love to be hated :-}


  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Next time Google? That's amazing advice. Not. Sometimes asking someone for help is 50x better then just using Google to find something.

    You learn a lot more when someone posts the code to a specific situation, and helps you learn that way. That way you know how to modify that code, and use it in the future.

  8. #8
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    Well, most people dont check google. And I mean, you dont learn if you dont explore...

    It isnt hard to search for something and put 2 and 2 toegther to get 4... i mean stop complaining and get on with life.

    Lew.
    Im not here to be loved, I love to be hated :-}


  9. #9
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Lewiie15 View Post
    Well, most people dont check google. And I mean, you dont learn if you dont explore...

    It isnt hard to search for something and put 2 and 2 toegther to get 4... i mean stop complaining and get on with life.

    Lew.
    It's hard to quit complaining when the only advice that is given around here is "check Google".

    If everyone checked Google all the time, there wouldn't be a need for this section of the forum.

    From 90% of your posts, at least one part of your post has something to do with checking Google, even if you have no idea what the post/topic is about.

    In the words of you, quit complaining people don't use Google and get on with life

  10. #10
    Join Date
    Jan 1970
    Posts
    0
    Tokens
    0

    Latest Awards:

    Default

    A lot of the time when I encounter a problem, it's a CSS or xHTML markup issue. Google can't help me with that, the searches return useless tutorials.

    However, you did help him out, so I can't be too critical.

Page 1 of 2 12 LastLast

Posting Permissions

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