|
Posted by J.O. Aho on 11/17/06 17:48
linda wrote:
> OK, sorry another question abouth the date_of_birth function that I have,
> how can I now insert into user_database the year, moth & day as one entry?
>
> At the moment this function produces drop downs, one for year one for month
> and so on, named as year, month etc. How would I convert this into
> date_of_birth to insert into a date field of that name in the user_database?
>
> Any help would be gratefully received.
>
> Many thanks in advance.
> Linda
>
>
>
You have to adjust this to how dates are used in your region/database
//This will result in a date like: YYYY-MM-DD
$bdate=$_REQUEST['year'] . '-' . $_REQUEST['moth'] .'-' . $_REQUEST['day'];
//We create a simple insert line for the database
$query="INSERT INTO table('name','birthday') VALUES('$name','$bdate')";
//We execute the query
$result=mysql_query($query);
Don't forget to connect to the database first and then check for fails in the
insert.
//Aho
Navigation:
[Reply to this message]
|