1

hi i'm trying to run this code to connect with my db.sqlite database file, but the server respond with

Failed to load resource: the server responded with a status of 500 (Internal Server Error) and the page is blank.

here's my code:

<?php

class MyDB extends SQLite3
{
     function __costruct()
       {
          $this->open('copiaDatabase.sqlite');
       }

}

$db = new MyDB();
echo $db->lastErrorMsg();
?>
5
  • Please add some log files or errors to debug the code Commented Sep 7, 2015 at 11:23
  • Sorry i'm new in php, where i can see log file? Commented Sep 7, 2015 at 11:26
  • see this link davidwinter.me/enable-php-error-logging for php logs and if you are running on apache then log files are located at /var/log/apache2/error.log Commented Sep 7, 2015 at 11:27
  • 1
    It should be __construct() instead of __costruct(). Commented Sep 7, 2015 at 11:34
  • thanks a lots for your answer i resolve....great! Commented Sep 7, 2015 at 11:38

1 Answer 1

2

As I mentionned in my comment, you have a typo:

It should be __construct() instead of __costruct().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.