mmarif4u Posted April 19, 2007 Share Posted April 19, 2007 Hi guys: i need some help on date function... Let me explain. i have a form where i use for loop to increment the date depend on the $_GET . <?php for($i=1;$i <= decrypt_str($_GET['cusers']);$i++){ echo'<select class="textbox2" name="dobdd[]">'; echo'<option value="1">1</option>'; <?php for($i=1;$i <= decrypt_str($_GET['cusers']);$i++){ echo'<select class="textbox2" name="dobmm[]">'; echo'<option value="1">1</option>'; <?php for($i=1;$i <= decrypt_str($_GET['cusers']);$i++){ echo'<select class="textbox2" name="dobyyyy[]">'; echo'<option value="1980">1980</option>'; I split the date into 3 parts like day,month,year. Then use this php main script to combine $dobdd=($_POST['dobdd']); $dobmm=($_POST['dobmm']); $dobyyyy=($_POST['dobyyyy']); $dtdob[] =$dobyyyy."-".$dobmm."-".$dobdd; The date is coming from array so in the $_GET there are 2 child. Then it will saved to db like this: $sql .= "`dtdob` = ('" . $dtdob[0] . "'), "; $sql .= "`dtdob` = ('" . $dtdob[1] . "'), "; The problem is that how to split the date for two or three child to enter it to the db seperatly for every child... Any help will appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
btherl Posted April 19, 2007 Share Posted April 19, 2007 Currently, you have code for 1 child to enter dob? And you want to extend it so 2 or 3 children can enter dob? Is that correct? And you want to know how to store that data in the database? Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 19, 2007 Author Share Posted April 19, 2007 Yes i want that,for that to split i use array. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 19, 2007 Author Share Posted April 19, 2007 Any idea guys. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted April 27, 2007 Author Share Posted April 27, 2007 I am struggling with it... Any comments on it guys. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.