...

View Full Version : Parse Error when sending to MySQL database



gsnedders
05-08-2004, 02:30 PM
My code for the page is:
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "geoffers_****", "******")
** or die("Could not connect : " . mysql_error());
echo "Connected successfully";
mysql_select_db("geoffers_w3") or die("Could not select database");

$sql = "INSERT INTO mapsdownload (name,description,url,validate) VALUES ('$name,'$desc','$url','1')";

/* Closing connection */
mysql_close($link);
?>

and the form page is
<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" />
</form>

gsnedders
05-08-2004, 02:41 PM
Fixed:


<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "geoffers_****", "********")
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')";

/* Closing connection */
mysql_close($link);
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum