View Full Version : Not being inserted into MySQL Database...

05-08-2004, 05:31 PM
The form:

<form action="newsubmit.php" method="post">
<label for="name">Name of Map:</label><input name="name" type="text" size="40" />
<label for="desc">Description of Map:</label> <textarea name="desc" rows="10" cols="40"></textarea>
<label for="url">URL for download:</label> <input name="url" type="text" size="40" />
<input name="name" type="submit" value="Submit" /> <input name="name" type="reset" value="Reset" />

The action
/* Connecting, selecting database */
$link = mysql_connect("localhost", "geoffers_w3", "************")
or die("Could not connect : " . mysql_error());
mysql_select_db("geoffers_w3") or die("Could not select database");

$sql = "INSERT INTO mapsdownload (name,description,url,validate) VALUES ('$name','$desc','$url','1')" or die (mysql_error());
echo("Please say this means it's worked");

/* Closing connection */

05-08-2004, 06:22 PM
The error is under mysql_select_db, it should be
mysql_select_db("geoffers_w3",$link) or die("Could not select database");