Hi,
I am getting an error message when trying to write to a database. This is the error message:
Invalid query: No Database Selected
This is my code:
//Make Data Base Connection
$sql = "INSERT INTO ptest VALUES (4, 'Andrew Balmos', 'ComputerNerd8888@cox.net', 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)";
$conn = mysql_connect('mysql.secureserver.net', 'pte********', '*******');
mysql_select_db('ptest', $conn);
//Create a Query
$result = mysql_query($sql, $conn) or die("Invalid query: " . mysql_error());
if ($results == FALSE){
print "<FONT face = arial color = red><h3>A Error with storing your test scores into a database has occurred please select back button and Re-Submit the test.</h3></FONT><br>";
$error = 1;
};
Do you see anything bad.. I have called mysql_select_db('ptest', $conn);... What else do I need to do... I try to add USE ptest to the database SQL but it would error off... Either way I don't care but please help me... Also is there any error in the SQL code?
Thanks,
Andrew