jrapin Posted November 3, 2006 Share Posted November 3, 2006 When I use this PHP code to link to my database, it tells me: Fatal error: Failed opening required 'DB.php' (include_path='/php\pear') in /home/webadmin/kewadin.com/html/calendar/cal_inc.php on line 4<?phpfunction connect() {ini_set("include_path", "C:\php\pear");require_once("DB.php");$type = "mysql";$username = "caladmin";$password = "caladmin";$host = "localhost";$database = "event_calendar";$dsn = $type . "://" . $username . ":" . $password . "@" . $host . "/" . $database;$dbconn = DB::connect($dsn);errortrap($dbconn);$dbconn->setFetchMode(DB_FETCHMODE_ASSOC);return $dbconn;}//end connect* I completed a search on our database for the "DB.php" file and it gave me this error message:#1064 - You have an error in your SQL syntax near 'DB.php' at line 1. How do I replace the incorrect programming information with the corect coding? Link to comment Share on other sites More sharing options...
shoz Posted November 3, 2006 Share Posted November 3, 2006 jrapin, double postng is not allowed. If you'd like to continue using this forum follow the [url=http://www.phpfreaks.com/forums/index.php/topic,6264.0.html]Board Guidelines[/url]. Link to comment Share on other sites More sharing options...
Recommended Posts