vzhen
vzhen

Reputation: 11157

Storing facebook user birthday to mysql

I am using Codeigniter and mysql.

I got the facebook user birthday with 01/23/1999 format

and I got date YYYY/M/D format in mysql table.

How can I insert it?

I tried but I got 0000/00/00 and also tried str_to_date() but no idea why codeigniter cannot pass it.

Upvotes: 0

Views: 920

Answers (2)

John Conde
John Conde

Reputation: 219844

$mysql_date = date("Y/m/d", strtotime('01/23/1999'));

Upvotes: 2

Westwick
Westwick

Reputation: 2497

$datetoputinmysql = date('Y-m-d', strtotime($facebookvariable))

Upvotes: 4

Related Questions