Jump to content

PHP Database Problem


ColoneLea

Recommended Posts

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!!

Link to comment
https://forums.phpfreaks.com/topic/72666-php-database-problem/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/72666-php-database-problem/#findComment-366392
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.