-7

im getting an error like this:- error in

INSERT into images_tbl ('images_path','submission_date') values('images/09-08-2014-1407586340.jpg','2014-08-09')

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 ''images_path','submission_date') 
values('images/09-08-2014-1407586340.jpg',' at line 1

Here is the query in which i'm getting an error:

$query_upload="INSERT into images_tbl ('images_path','submission_date')      values('".$target_path."','".date("Y-m-d")."')";
idmean
  • 14,540
  • 9
  • 54
  • 83
vaibhav kumar
  • 11
  • 1
  • 6

1 Answers1

2

You should use backticks to quote column names in MySQL, not single quotes. But your column names don't need quotes at all. Use

INSERT into images_tbl (images_path,submission_date) values('images/09-08-2014-1407586340.jpg','2014-08-09') 

instead.

VMai
  • 10,156
  • 9
  • 25
  • 34