MadamZuZu
04-27-2007, 01:11 PM
hi :)
im VERY new to PHP.
i'm tyring to connect to a db. and it's just not working :(
please help.
this is what i did to create the database:
CREATE TABLE Quotes (
ID int(11) NOT NULL auto_increment,
Quote char(255) default NULL,
Name char(255) default NULL,
IP char(255) default NULL,
Date char(255) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
this is what i'm using to connect to it:
$dbhost = "myhost";
$dbusername = "myusername";
$dbuserpass = "mypassword";
$default_dbname = "quotes";
$connection = mysql_connect($dbhost, $dbusername, $dbuserpass);
if (!$connection)
{
die('Could not connectooo: ' . mysql_error());
}
print "++Connected to MySQL<br>";
print"default: $default_dbname";
@mysql_select_db($default_dbname) or die( "Unable to select database");
and i keep getting this as the output:
++Connected to MySQL
default: quotesUnable to select database
pleeeaase help
im VERY new to PHP.
i'm tyring to connect to a db. and it's just not working :(
please help.
this is what i did to create the database:
CREATE TABLE Quotes (
ID int(11) NOT NULL auto_increment,
Quote char(255) default NULL,
Name char(255) default NULL,
IP char(255) default NULL,
Date char(255) default NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
this is what i'm using to connect to it:
$dbhost = "myhost";
$dbusername = "myusername";
$dbuserpass = "mypassword";
$default_dbname = "quotes";
$connection = mysql_connect($dbhost, $dbusername, $dbuserpass);
if (!$connection)
{
die('Could not connectooo: ' . mysql_error());
}
print "++Connected to MySQL<br>";
print"default: $default_dbname";
@mysql_select_db($default_dbname) or die( "Unable to select database");
and i keep getting this as the output:
++Connected to MySQL
default: quotesUnable to select database
pleeeaase help