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
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default Dont know whats wrong..

    Im making a script that automatically resets the HabboSoft UserSystem!

    So far, i have this code

    PHP Code:
    <?php
    require("config.php");
    $dump = @file_get_contents("SQL.txt");
    mysql_query($dump);
    ?>
    The SQL.txt file is CHMODDed to 0644

    And ive tried running the file in phpmyadmin seperately and it works fine, however, the script doesnt affect the database at all. It just seems to do nothing.

    Ive tried print_r'ing the $dump variable and all the SQL is there.

    Any suggestions?

    Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time.
    Last edited by Agesilaus; 01-01-2008 at 03:52 AM.
    Coming and going...
    Highers are getting the better of me

  2. #2
    Join Date
    Jun 2005
    Posts
    2,688
    Tokens
    0

    Latest Awards:

    Default

    Try using file() instead of file_get_contents

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

    Latest Awards:

    Default

    Made no difference :S
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    Jun 2005
    Posts
    2,688
    Tokens
    0

    Latest Awards:

    Default

    If it is a static file why not just post the SQL into a variable? Then you won't have to mess about with file handling

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

    Latest Awards:

    Default

    Well surely using
    PHP Code:
    file_get_contents(); 
    OR

    PHP Code:
    file(); 
    is the same as posting it into a variable, without the need to worry about backslashing quotations.?
    Coming and going...
    Highers are getting the better of me

  6. #6
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    Try having

    PHP Code:
     <?php
    include; ("config.php");
    $dump = @file_get_contents("SQL.txt");
    mysql_query($dump);
    ?>
    </span> </span>

  7. #7
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    why did you put a ; after include???

    PHP Code:
    <?php
    include("config.php");
    $dump = @file_get_contents("SQL.txt");
    mysql_query($dump);
    ?>
    There sorted Kane's error
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

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

    Latest Awards:

    Default

    is that not the same as what i posted first..? :S
    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
  •