anuj_web
New Member
- Messages
- 145
- Reaction score
- 0
- Points
- 0
<?php
$dbcnx = @mysql_connect('localhost', 'username', 'password');
if (!$dbcnx) {
echo( '<p>Unable to connect to the ' . 'database server at this time.</p>' );
exit();
}
mysql_select_db('anujweb_donor', $dbcnx);
$sql = 'CREATE TABLE anuj(donorID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name text)';
if ( @mysql_query($sql) ) {
echo('<p>donor table successfully created!</p>');
} else {
die('<p>Error creating Jokes table: ' .mysql_error() . '</p>');
}
?>
It returns an error no database selected
PS:usename password intentionaly hidden
$dbcnx = @mysql_connect('localhost', 'username', 'password');
if (!$dbcnx) {
echo( '<p>Unable to connect to the ' . 'database server at this time.</p>' );
exit();
}
mysql_select_db('anujweb_donor', $dbcnx);
$sql = 'CREATE TABLE anuj(donorID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name text)';
if ( @mysql_query($sql) ) {
echo('<p>donor table successfully created!</p>');
} else {
die('<p>Error creating Jokes table: ' .mysql_error() . '</p>');
}
?>
It returns an error no database selected
PS:usename password intentionaly hidden