Jump to content

Date function from array


mmarif4u

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.