Jump to content

No Database Selected


Imoddedu

Recommended Posts

<head><title>Register Test</title></head><body><?php$con = mysql_connect("----","----","---");if (!$con)  {  die('Could not connect: ' . mysql_error());  }mysql_select_db("TestLogins, $con");$sql="INSERT INTO logins (user, pass)VALUES('$_POST[user]','$_POST[pass]')";if (!mysql_query($sql,$con)){die('Error: ' . mysql_error());}echo "You have been registered!";mysql_close($con)?></body></html>

The problem is that it says no Database is selected. I have made the database TestLogins.

Link to comment
Share on other sites

mysql_select_db("TestLogins, $con");TestLogins was wrong. Apparently it is the same as the same in this bit of code

$con = mysql_connect("----","----","---");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...