Date: 01/22/06 (PHP Community) Keywords: database
I'm having trouble with this script. It's supposed to insert data froma form into a database and upload a file. The file is uploadingproperly, but nothing is going into the database. Anyone ever have asimilar problem? Any idea how I can fix it?ini_set ('display_errors', 1);error_reporting (E_ALL & ~E_NOTICE);if (isset ($_POST['submit'])) {if (move_uploaded_file ($_FILES ['photo']['tmp_name'], "portfolio/{$_FILES['photo']['name']}")) {print 'Your file has been uploaded.';}}$url = $_POST["url"];$title = $_POST["title"];$description = $_POST["description"];$category = $_POST["category"];$dt = date("Ymd");if ($submit) {$db = mysql_connect("10.0.11.66", "xxxxx", "xxxxx");mysql_select_db("dweia");$sql = "INSERT INTO 'photos'('url','title','description','category','date') VALUES('$url','$title','$description','$category','$dt',)";$result = mysql_query($sql);echo 'Go back';} else{?>Enter photo name: (ie, filename.jpg)Title:Choose a category: LandscapeStage & Event PhotographyTravel PhotographyPortraiturePhotojournalism</option>Fashion PhotographyMiscellaneousDescription:
Your file has been uploaded.
Source: http://community.livejournal.com/php/399935.html