Grabbing the current date and the ip address

I have a mysql table with the following 2 data fields

regdate date NOT NULL,
regip varchar(30) NOT NULL default ‘’,

Is this the correct way to capture both the current date (YYYY-MM-DD) and the IP address.

$date = curdate();

or is this a good way to caapture the current datew

$date = date("Ymd");                           

lukeurtnowski, MySQL expects its dates to be formatted yyyy-mm-dd. Because of this you’re going to have to format the date for input. For example:

$date = date(“Y-m-d”);

echo $date;
echo $ip;

//create sql query for insert

Best of luck.