
February 20th, 2013, 01:45 PM
|
|
Contributing User
|
|
Join Date: Jan 2013
Posts: 37
Time spent in forums: 12 h 20 m 46 sec
Reputation Power: 1
|
|
|
PHP-DB - I keep getting upload failed message
It is executing everthing up to the part of the mysql_query
PHP Code:
<?php
include 'connect.php';
//assigning variables to different values of $_FILES array
$name = addslashes($_FILES['upload']['name']);
$tn = addslashes($_FILES['upload']['tmp_name']);
$size = $_FILES['upload']['size'];
$desc = $_POST['description'];
if(!isset($_FILES['upload'])){
echo 'Please select an image!';
}else{
$image = file_get_contents($tn);
$image_name = $name;
$image_size = getimagesize($tn);
if($image_size == FALSE){
echo 'Sorry, but that is not an image!<br /><br /><a href="index.php">Go Back</a>';
}else{
if(!mysql_query("INSERT INTO `Group_1` VALUES('', '$image_name', '$desc', '$image')")){
echo 'Sorry, but the file upload failed!<br /><br /><a href="index.php">Go Back</a>';
}else{
echo 'File upload succesful!';
}
}
}
?>
then when I try to separate the mysql query I get this 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 '()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄ' at line 1
|