how to change string into date in mysql

how to change string into date in mysql



//how to change string into date in mysql 
str_to_date(string_data, format)


  Example : 
  
  select *,floor(datediff('".date("Y-m-d")."',str_to_date('dob','%d-%m-%Y'))/365) as agediff from tablename 
  
  dob = column name  and varchar type 

Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress