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
https://forums.phpfreaks.com/topic/47678-date-function-from-array/
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.