I have written code that inserts some text data and also an image file through a form. the form processor code does not have to only insert and upload data but also create thumbnail for the image.
Now everything for image upload and creating the thumbnail works fine BUT when it comes to database and inserting the data into the table it doesn't insert data. I checked my database connection it is working fine. I also checked the same code in my localhost computer it works fine there too.
Note: I don't get any errors but it doesn't insert data into the database. I use godaddy.
Any cooperation and help will be highly appreciated.
Since the complete code is too long, Here is the code portion that has to insert data into the database.
include 'dbcon.php';
//error_reporting(E_ALL ^ E_NOTICE);
if(isset($_POST['submit']))
{
$file = ($_FILES['file']['name']);
$author = $_POST['author'];
$album = $_POST['name'];
$imgdetails = $_POST['imgdetails'];
$details = $_POST['details'];
$datetime=date("M d, Y"); //date time
$jalali_date = jdate("l d p Y",$timestamp);
$query = "INSERT INTO `fslide` (`picture`,`author`, `album`, `imgdetails`, `details`, `date`, `fdate`)
VALUES ('$file', '$author', '$album', '$imgdetails', '$details', '$datetime', '$jalali_date');";
$sql = mysql_query ($query);
Aucun commentaire:
Enregistrer un commentaire