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 8 of 8
  1. #1
    Join Date
    Apr 2006
    Location
    England
    Posts
    1,159
    Tokens
    0

    Latest Awards:

    Default Solve my PHP Problem

    I'm working on a Staff Page for my new website and I have put together my own PHP Staff System allowing administrators to add users into categorys of the page without cPanel access.

    I'm having problems with the Staff Page itself though. As you will be able to see in my code below; where echo is in the second while function - I am showing the users infomation which has been collected from the database. My page can only contain a few of these pages before it makes the content box bigger.

    PHP Code:
    <font class="heading">The Team</font><br>
    <?
    $forum_names 
    mysql_query("SELECT * FROM staffcategorys");
    while(
    $name mysql_fetch_array($forum_names))
    {
    ?>
    <b><? echo"$name[name]"?></b> - <? echo"$name[description]"?><br><br>
    <?
    echo'<table width="100%" align="center"><tr>';
    $staff_names mysql_query("SELECT * FROM staffmembers WHERE fid = $name[id]");
    while(
    $staff mysql_fetch_array($staff_names))
    {
    ?>
    <td align="center" width="25%" style="padding-bottom: 10px;"><img src="<? echo"$staff[avatar]"?>" border="0" alt="<? echo"$staff[habboname]"?>"><div style="padding-top: 4px;"><b><? echo"$staff[habboname]"?></b><br><? echo"$staff[jobtitle]"?></div></td>
    <?
    }
    echo
    '</tr></table>';
    }
    I've been searching Google for a long time trying to firgure out how I could make it so:

    For every Third, Sixth, Ninth, Tewlth and so on (3 times table) <td displaying the details* (that is created from:

    PHP Code:
    $staff_names mysql_query("SELECT * FROM staffmembers WHERE fid = $name[id]");
    while(
    $staff mysql_fetch_array($staff_names))

    )

    * a </tr><tr> is inserted so my content box does not expand.

    If you do not understand me, please let me know. This is not an easy think to explain.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  2. #2
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    693
    Tokens
    0

    Default

    From memory, on double (and single) quotes that aren't a part of the php code in itself, but in the code, you need to put a / before it?
    XHTML, CSS, AJAX, JS, php, MySQL.

    --

    HxF moderators can't read timestamps.

  3. #3
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Change:
    PHP Code:
    echo'<table width="100%" align="center"><tr>'
    To:
    PHP Code:
    echo"<table width=\"100%\" align=\"center\"><tr>"

  4. #4
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    As Tom didnt explain, I shall

    When using " in print, echo and so on you must use a \ before.

    \"

    Thanks,
    Danny

  5. #5
    Join Date
    Apr 2006
    Location
    England
    Posts
    1,159
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Organised
    Change:
    PHP Code:
    echo'<table width="100%" align="center"><tr>'
    To:
    PHP Code:
    echo"<table width=\"100%\" align=\"center\"><tr>"
    My script works fine. You don't have to be a PHP nerd to know that if you use echo' and '; to start/end your echo, it will allow "'s inside and vice versa.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have text in your signature which is over size 4.

  6. #6
    Join Date
    May 2006
    Posts
    108
    Tokens
    0

    Default

    Hey everyone from the nerdy part of the forum.

    I wish I was a web designing nerd hehe~~~~~~~~

  7. #7
    Join Date
    Aug 2005
    Location
    Location Location
    Posts
    1,730
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Placeeee
    Hey everyone from the nerdy part of the forum.

    I wish I was a web designing nerd hehe~~~~~~~~
    Well, that was spam

  8. #8
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Placeeee
    Hey everyone from the nerdy part of the forum.

    I wish I was a web designing nerd hehe~~~~~~~~
    A NERD AHEM? RUDE!

    Anyway.

Posting Permissions

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