Jacobb123
09-02-2006, 04:17 PM
I am new to PHP and MYSQL and am trying to learn it. I am trying to run a simple script but it keeps telling me that the database does not exist.
<?php
$dbuser="---------";
$dbpass="---------";
$dbname="jacobb-1"; //the name of the database
$chandle = mysql_connect("localhost", $dbuser, $dbpass)
or die("Connection Failure to Database");
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found. ");
?>
Iit keeps telling me that the database is not found. it connects allright but then gives the error that the databsae is not found. Can someone tell me why? I have made sure that the DB name is correct. I'm at a loss here.
<?php
$dbuser="---------";
$dbpass="---------";
$dbname="jacobb-1"; //the name of the database
$chandle = mysql_connect("localhost", $dbuser, $dbpass)
or die("Connection Failure to Database");
mysql_select_db($dbname, $chandle) or die ($dbname . " Database not found. ");
?>
Iit keeps telling me that the database is not found. it connects allright but then gives the error that the databsae is not found. Can someone tell me why? I have made sure that the DB name is correct. I'm at a loss here.