HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Location
    West Midlands
    Posts
    1,168
    Tokens
    0
    Habbo
    Jibbish

    Latest Awards:

    Default [PHP&MYSQL] Help

    Ok, i've got this profile system thing. And I want it so if there is not a record in the database for Hobbies: so on the profile itself it wont display the category Hobbies:

    Does anyone know how to do this? +REP is giving for everyone who tries

  2. #2

    Default

    Just do your query, and when it comes to the Hobbies section check whether the result for their hobbies is null or not. If it is, don't echo the HTML for that section.

    PHP Code:
    if ($result// Just checking if there was a result
    {
         echo 
    "<strong>Hobbies:</strong> $result";

    Last edited by JohnSoutar; 23-03-2008 at 06:00 PM.
    i'm well 'ard.

  3. #3
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    John's one seem's about right, if you want it to display something like 'THERE WAS NO RECORD!'

    then do this..

    PHP Code:
    <?php
    if ($result// Just checking if there was a result
    {
         echo 
    "<strong>Hobbies:</strong> $result";

    else
    {
    echo(
    'THERE WAS NO RECORD');
    ?>
    I think that's right

Posting Permissions

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