coolgamer48 Posted December 8, 2007 Report Share Posted December 8, 2007 When I try to run this script: <html> <body> <form action = "mysql_test2.php" method = "post"> First Name: <input type = "text" name = "firstname" /><br /> Last Name: <input type = "text" name = "lastname" /><br /> <input type = "submit" value = "Submit" /> </form> <?php $con = mysql_connect("fdb1.awardspace.com","coolgamer48_sql1","admin"); if ($con == false) { die("mysql connection failed<br />"); } if (mysql_close($con) == false) { die("mysql connection did not close properly<br />"); } mysql_select_db("coolgamer48_sql1",$con); $sql = "CREATE TABLE person ( UID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(UID), FirstName varchar(15), LastName varchar(15) )"; mysql_query($sql,$con); if (isset($_REQUEST[firstname]) == true && isset($_REQUEST[lastname]) == true) { $sql = "INSERT INTO person(FirstName, LastName) VALUES('$_REQUEST[firstname]','$_REQUEST[lastname]')"; mysql_query($sql,$con); } ?> </body><html> I get these errors:Warning: mysql_select_db(): 1 is not a valid MySQL-Link resource in /home/www/alecbenzer.awardspace.com/mysql_test2.php on line 18Warning: mysql_query(): 1 is not a valid MySQL-Link resource in /home/www/alecbenzer.awardspace.com/mysql_test2.php on line 26Anyone know what these two mean? Link to comment Share on other sites More sharing options...
coolgamer48 Posted December 8, 2007 Author Report Share Posted December 8, 2007 Haha,nvm - I was closing the database connection and then trying to access it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now