![]() ![]() 'We're sorry but there was an error while trying to connect to the database'Ĭan anyone please point me in the right direction, any help would be absolutely awesome!ĮDIT: Ok, now I'm getting really lost - I've been looking at my code and can't figure out why i'm getting the error: Fatal error: Call to a member function fetch() on a non-object in D. I run the script and I just get this message: Assignment: Create New Access Database Open Microsoft Access to the Home page Chose New Database: Choose from one of the ways to create a new database and. $sql = $this->con->prepare("SELECT * FROM celebs") I have a basic idea, something along these lines: include_once '/pages/classes/connectionClass.php' So what I'm trying to find out is where the $dbName variable goes and also how I would I could call the connection class in an index page along with an SQL statement. ![]() $this->con->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION) Įcho 'We\'re sorry but there was an error while trying to connect to the database' įile_put_contents('', $e->getMessage().PHP_EOL,FILE_APPEND) NB: I'm completely new to setting up PHP with a Microsoft Access database and I know my $dbName is probably in the wrong place and I'm not sure where it goes to be honest! class connection DBQ=$dbName Uid=Admin Pwd= ") ![]() So far I have this, i've tried to adapt it from other articles on Stack Overflow: Basically, I'm trying to set up a PDO connection class with a Microsoft Access database with PHP so I can call the class when I'm creating new pages. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |