I have the string 04/04/2012 04:03:35 AM. How can I convert it and insert into a table? Field type is datetime.
04/04/2012 04:03:35 AM
datetime
You need to use STR_TO_DATE():
STR_TO_DATE('04/04/2012 04:03:35 AM', '%d/%m/%Y %r')
Or, better yet, present your literal in a format MySQL expects (e.g. YYYY-MM-DD HH:mm).
YYYY-MM-DD HH:mm