php - 1064 - You have an error in your SQL syntax -


do have date formated wrong?

 1064 - have error in sql syntax;  check manual corresponds mysql  server version right syntax use near  '%m-%y').', '.date('h:i:s a').', '3', '1', 'title', 'pr', 'bpm001')' @ line 1 
insert names(com_id,rec_date,rec_time,rec_type,rec_request,rec_by,batch_id) values('300','.date('%d-%m-%y').','.date('h:i:s a').','3', '1', 'title', 'pr', 'bpm001') 

you can try this.

$q= "insert names(com_id,rec_date,rec_time,rec_type,rec_request,rec_by,batch_id) values('300', '".date("%d-%m-%y")."', '".date("h:i:s a")."', '3', '1', 'title', 'pr', 'bpm001')";


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -