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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.