A
Anonymous
Guest
I keep getting "Unable to select requested database." whywhywhywhywhyw!!!!!!??????
Code:
<?
$mysql_database="journal";
$mysql_username="root";
$mysql_password="";
$mysql_host="localhost";
$link = mysql_connect($mysql_host,$mysql_username,$mysql_password) or die ("unable to connect to SQL
server");
mysql_select_db($mysql_database, $link) or die ("unable to select database");
{
$query ="Insert Into entries (title, entry, date) Values ($title', '$entry', '$date')";
$date = date('m d, Y');
$db_query = mysql_query($query, $link) or die ("Unable to select requested database.");
}
mysql_close;
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table align="center" border="1" bordercolor="#000000" cellspacing="0" cellpadding="3"
bgcolor="#a1a1a1">
<tr><td><font face="Verdana" size="0" color="#000000">Title:</td><td><input type="text" name="title"
maxlength="40"></td></tr>
<tr><td><font face="Verdana" size="0" color="#000000">Entry:</td><td><textarea name="entry" cols="100"
rows="10"></textarea></td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="update" value="Update"></td></tr>
</table>
</form>