ColoneLea Posted October 10, 2007 Share Posted October 10, 2007 I have this database problem and it's killing me. Basically I am running my script locally and whenever I try to create a database I get this problem. "Fatal error: Call to undefined function dba_open() in C:\Program Files\EasyPHP 2.0b1\www\test.php on line 10" The PHP code is as follows: <?php print "<h3>Adding Values to a Database</h3>" . "<p>Adding products now....</p>"; $dbh = dba_open("./data/products", "c", "gdbm") or die ("Could not open the database in question"); dba_insert ("Sonic Screwdriver", 23.20, $dbh); dba_insert ("Tricorder", 55.55, $dbh); dba_insert ("ORAC AI", 2200.50, $dbh); dba_insert ("HAL 2000", 4500.00, $dbh); dba_close($dbh); ?> I have basically wrote this from a book, so supposidly this is suppose to be correct, does anybody have any information. Somebody has to be out there who can help!! Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/ Share on other sites More sharing options...
GingerRobot Posted October 10, 2007 Share Posted October 10, 2007 Well, ive never worked with this type of database, however the obvious question to ask is if you have the php_dba extension loaded? Check your php.ini file for this line: ;extension=php_dba.dll You'll need to remove the semi colon. Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366388 Share on other sites More sharing options...
ColoneLea Posted October 10, 2007 Author Share Posted October 10, 2007 I previously did, but I got this instead as the error message: "Warning: dba_open(./data/products,c) [function.dba-open]: No such handler: gdbm in C:\Program Files\EasyPHP 2.0b1\www\test.php on line 10 Could not open the database in question" As you can see the problem is still there. Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366392 Share on other sites More sharing options...
ColoneLea Posted October 10, 2007 Author Share Posted October 10, 2007 Does anybody have any advise? Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366427 Share on other sites More sharing options...
darkfreaks Posted October 10, 2007 Share Posted October 10, 2007 dba_open ( string $path, string $mode [, string $handler [, mixed $...]] ) Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366431 Share on other sites More sharing options...
ColoneLea Posted October 10, 2007 Author Share Posted October 10, 2007 Sorry, this did not help my problem. I am too new on the subject to understand what you typed. Sorry. Quote Link to comment https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.