I am not sure I understand exactly what you are trying to do.
Once you set a value in a cookie, the next visit you can retrieve the values by using $CookieVarName or by using $HTTP_COOKIE_VARS["CookieVarName"] and then put that data into your database just as you would any other data.
I am not sure if that is what you mean though. A more typical use might be to have the user provide some data. You store that data in your table normally. Then you also create and store along with their information some unique identifier that you also put into a cookie. That way when they return you retrieve this unique identifier from their cookie and that allows you to pull up their record with all of the other information.
If that doesnt answer your question, please tell us specifically what part you need to know.
Hope that helps,
Richard