Fatal Error Wth PHP script install - Would appreciate a look see

Discussion in 'PHP' started by kentuckyslone, Jul 17, 2008.

  1. #1
    I am in the midst of setting up a php script and I am getting the following error:

    Here is the relevant peice of code (where the error is supposed to be:

    Do you see any errors in the way this code is set up to create the tables? By the way, the script has a browser based installation procedure where you enter the db information.
     
    kentuckyslone, Jul 17, 2008 IP
  2. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #2
    the code looks rather correct, the error means that you attempted to use a method of the class Install that does not exist, or in short, the createTables() function might now be exitsing.

    it would help a lot if you could post the code for the Install class
     
    serialCoder, Jul 17, 2008 IP
  3. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #3
    Here is the entire code that the above snippet is from:

     
    kentuckyslone, Jul 17, 2008 IP
  4. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #4
    can you post the code for this file?

    require_once('../lib/Install.class.php');
     
    serialCoder, Jul 17, 2008 IP
  5. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #5
    OK, its a long one. In fact when I tried to post it I got an error saying that it was two long so I will have to break it up into two seperate posts:

     
    kentuckyslone, Jul 17, 2008 IP
  6. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #6
    Part two of three:

    Here is the rest of it:

     
    kentuckyslone, Jul 17, 2008 IP
  7. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #7
    Part three of three:

     
    kentuckyslone, Jul 17, 2008 IP
  8. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #8
    nope, the createTables function is not there...

    i think based on structure alone...

    can you try replacing this line

    $inst->createTables

    with $sql->createTables
     
    serialCoder, Jul 17, 2008 IP
  9. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #9
    like on your first post

    this line

    $inst->createTables($_POST['db_host'], $_POST['db_name'], $_POST['db_user'], $_POST['db_pw']);

    replace the $inst with $sql

    $sql->createTables($_POST['db_host'], $_POST['db_name'], $_POST['db_user'], $_POST['db_pw']);
     
    serialCoder, Jul 17, 2008 IP
    kentuckyslone likes this.
  10. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #10
    I made that change but still got the same error:

     
    kentuckyslone, Jul 17, 2008 IP
  11. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #11
    damn, i saw the 2nd part too late, there is a createTables function in the Install class
     
    serialCoder, Jul 17, 2008 IP
  12. Mozzart

    Mozzart Peon

    Messages:
    189
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    A question, a bit of a rare sight but what is the version of php there? scopes like that are only available in PHP4 as far as I know (I might be wrong) PHP5 changed the whole thing to another approach.
     
    Mozzart, Jul 17, 2008 IP
  13. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #13
    hmm, that's rather weird the function is in the class alright
     
    serialCoder, Jul 17, 2008 IP
  14. Mozzart

    Mozzart Peon

    Messages:
    189
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Mozzart, Jul 17, 2008 IP
  15. kentuckyslone

    kentuckyslone Notable Member

    Messages:
    4,371
    Likes Received:
    367
    Best Answers:
    0
    Trophy Points:
    205
    #15
    Hmmm, well the script may have been written before PHP5 came out. In the Server Requirements it says PHP 4 or higher

    Here is the script I am working with http://paypalmemberscript.com/
     
    kentuckyslone, Jul 17, 2008 IP