Code: Select all
<?php
include ( "dbconnect.php" );
if ( ($_FILES['fupload']['type'] == "image/gif") OR ($_FILES['fupload']['type'] == "image/png") OR ($_FILES['fupload']['type'] == "image/jpeg") ) {
$source = $_FILES['fupload']['tmp_name'];
$target = "photos/".$_FILES['fupload']['name'];
$targetthumb = "photos/thumb-".$_FILES['fupload']['name'];
move_uploaded_file( $source, $target );
print "<b>Upload successful</b><br>";
print "<a href=\"admin.php\">Return</a>";
} else {
print "Upload failed, please try again";
}
$title = $_POST[title];
$desc = $_POST[desc];
print $title."<br>";
print $desc."<br>";
print $target."<br>";
print $targetthumb."<br><br>";
$query = "INSERT INTO entries (ID, title, desc, filepath, thumbpath) VALUES('', '$title', '$desc', '$target', '$targetthumb')";
print $query."<br><br>";
mysql_query( $query ) or die ( mysql_error() );
mysql_close( $link );
?>This is what I get from mysql_error():
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, filepath, thumbpath) VALUES('', 'third inr comic', 'hope t
Thank you all for having a look, it's really important I get this working (it's for a major project at school) and I am quite stumped at this point.
- Drummer87