Jump to content

Recommended Posts

I have been writing a simple application that is sort of like a blogging engine. I have almost all of the code done(EXTREMELY simple) and something has gone wrong with the script that creates the database.

 

Here it is:

<html>
<head>
<link rel="stylesheet" type="text/css"
href="style.css" />
</head>
<body>
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

if ($dbc = @mysql_connect ('localhost', 'root', 'vertrigo')) {
print 'connected to MySQL!';

if (@mysql_guery ('CREATE DATABASE mysticky')) {
print 'You have created a database!';
} else {
die ('could not create the Database becuase: ' . mysql_error());
if (@mysql_select_db ('mysticky')) {
print 'The database has been selected!';
} else {
die('The database has not been selected because: ' . mysql_error() . 'Too bad!');
}
	mysql_close();
} else {
die('Could not connect to MySQL');
}
?>
</body>
</html>

 

my output has just been:

connected to MySQL

 

Help!

 

Thanks

<html>
<head>
<link rel="stylesheet" type="text/css"
href="style.css" />
</head>
<body>
<?php
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

if ($dbc = mysql_connect ('localhost', 'root', 'vertrigo')) {
print 'connected to MySQL!';

}elseif ( mysql_guery ('CREATE DATABASE mysticky')) {
print 'You have created a database!';

die ('could not create the Database becuase: ' . mysql_error());
}elseif (mysql_select_db ('mysticky')) {
print 'The database has been selected!';
} elseif 

die('The database has not been selected because: ' . mysql_error() . 'Too bad!');

}
	mysql_close();

else {
die('Could not connect to MySQL');
}

?>
</body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.