When attempting to store data in a MySQL database, it refuses to find
the database, thought I'm sure it is typed correctly (I am
copy/pasting it from phpMyAdmin). Here is the coding in question:
<?php
$username="username"; // Not actual username
$password="password"; // Not actual password
$database="brettuz_sdm"; // Copy and pasted from phpMyAdmin
$Time=$_POST['Time'];
*/ Submitted from a form, there are many variables, all in the same
fashion as this */
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO sdms VALUES ('','$Time')";
mysql_query($query1);
mysql_close();
?>
When submitting the form, I get a blank white page with "Unable to
select database" (just as specified in coding)
All my server host could tell me was "Check the database connection in
the page that the form submits to".... DUH =/
What is the problem here? |