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 9 of 9
  1. #1
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default php coding is this correct

    PHP Code:
    mysql_close($ms); 
    does that work or is it wrong :s

  2. #2
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Yeah, as long as that variable is the connection handle.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  3. #3
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    but i keep getting a error:
    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/habbotea/public_html/djp/bannedsongs.php on line 58

    here is coding:
    <? session_start();

    include 'database.php';

    $ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user

    if(!isset($_SESSION['session_username']) || empty($_SESSION['session_username']) || $ip!= $_SESSION['session_ip']) {

    //if the username is not set or the session username is empty or the ip does not match the session ip log them out

    session_unset(); //clears firefox

    session_destroy(); //clears IE

    die("You are not logged in - Please Log In"); }

    include("ol.php");?><body bgcolor="#3366FF">

    <p><font face="Verdana" size="1"> Below Are A List Of Songs That Have Been Banned By The Administrator.<br>
    <b>Please Do Not Play Any Of These Songs Or You Will Be Issued With A Formal Ban By One Of Our Administrators !</b>

    <? if($_SESSION['session_level'] == "1") { ?>

    </font><font face="Verdana" size="1"><br><a href="?action=delete">Delete All</a>

    <? } ?>

    <?

    $query = mysql_query("SELECT * FROM `bannedsongs` ORDER BY `id`");

    while($result = mysql_fetch_array($query)) {

    $Song = $result["Song"];

    $From = $result["From"];

    $Long = $result["Long"];



    echo "<p><b>Song: $Song </b>has been banned<br><b>Banned From:</b> $From<br><b>For: </b>$Long</b><br><hr color='#000000' size='1'><br>";



    if($action == "delete") {

    $delete = mysql_query("TRUNCATE TABLE `bannedsongs`");

    echo "All Banned Songs In The System Have Been Deleted.";



    }

    }

    mysql_close($ms);

    ?>

    </font> </font> </td>

    </tr>

    </table>

    </td>

    </tr>

    </table>

    </body>

    </html>
    Edit: 58th line:
    PHP Code:
     mysql_close($ms); 
    Last edited by Jamie.; 07-04-2006 at 05:28 PM.

  4. #4
    Join Date
    Dec 2005
    Posts
    2,992
    Tokens
    1,531

    Latest Awards:

    Default

    Does it means the table doesn't exist or isn't setup properly?
    That went fast.

  5. #5
    Join Date
    Sep 2005
    Posts
    1,604
    Tokens
    0

    Latest Awards:

    Default

    i think it means the table does not exist. what panel is it?

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

    Latest Awards:

    Default

    I cant see to see where your connection to the DB is.. Could you post database.php please.

  7. #7
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    d/w, fixed now i deleted that bit and it works clever me

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

    Latest Awards:

    Default

    Quote Originally Posted by bondie0072
    d/w, fixed now i deleted that bit and it works clever me
    I wouldent recomend deleting it.

  9. #9
    Join Date
    Jul 2005
    Location
    -
    Posts
    2,995
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Organised
    I wouldent recomend deleting it.
    lol works :s

Posting Permissions

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