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 2 of 2
  1. #1
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default Quick php Help [quick]

    Ok this is just abit of the script, this bit is in the middle of the page.

    Basicly i want it so when type in a username if fetchs the infomation i want, here is my code.

    (Yes i already have db_connect.php etc, as i said this is only a part of the page)

    PHP Code:

          <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" class="thinline">

      <tr background="includes/grad.jpg">

                <td height="21" colspan="5" background="skins/<?php echo"$fetch->skin"?>/grad.jpg"><div align="center">
                    View a user's Info</div></td>

      </tr>

      <tr>

        <td width="163" align="center">Money</td>

        <td width="162" align="center">Bullets</td>

        <td width="148" align="center">Credits</td>

        <td width="191" align="center">Rankpoints</td>

        <td width="200" align="center">Health</td>

      </tr>

       <?php

    if ($_POST['search24']){

    $usernameisa $_POST['username24']; 

    }

      
    $kkk=mysql_query("SELECT * FROM `users` WHERE `to`='$usernameisa' OR `from`='$usernameisa' ORDER BY id");

           while(
    $ppp=mysql_fetch_object($kkk)){

           echo 
    "

           <tr>

              <td>
    $ppp->money</td>

              <td>
    $ppp->bullets</td>

              <td>
    $ppp->credits</td>

              <td>
    $ppp->rankpoints</td>

              <td>
    $ppp->health</td>

            </tr>"
    ;

            }

            
    ?>

      <tr>

        <td height="26" colspan="5" align="center">Username:

          <input type="text" name="username24" id="username24" />

          <input type="submit" name="search24" id="search24" value="Search Username" /></td>

      </tr>

    </table>

  2. #2
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Whats with the $fetch-> :S

    Im taking it that it works though :S

    Um. You want it so that 'onkeypress' it looks for information in the database without having to refresh the page?

    If so, use scriptaculous as you cant do it with plain php...
    Coming and going...
    Highers are getting the better of me

Posting Permissions

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