MySQL Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rafee
Forum Newbie
Posts: 1
Joined: Tue Aug 12, 2003 6:18 pm
Location: Pittsburgh PA
Contact:

MySQL Problem

Post by Rafee »

Hi,

I'm a relatively new PHP programmer, and I just started working with MySQL databases. WHen I try to connect to a database, I get this error:

Warning: driver initialization failed in C:\indigoperl\apache\htdocs\index.php on line 3
Couldn't open database

This is the code for my PHP file: (pretty simple because I'm just starting it)

<?php

$dbh = dba_open("./data/icewolf","w","db3") or die("Couldn't open database");

?>

The PHP file is located in C:\indigoperl\apache\htdocs and the MySQL directory for my databases is C:\mysql\data Am I looking for the wrong directory maybe when I call the dba_open function? I have no clue :P Can someone please help me?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

I would recommend mysql_connect() instead.

If i'm not mistaking, dba_open is filebased in a different form than mysql.
Post Reply