I'm sorry, i'm a newbie in php.

And i have a lot of problems when i develop. So this is another problem i met.

form.php:

<form  method="post" action="process.php">
			<h1>BESOIN </h1>
			<br><br>
			<label>Sujet:</label><input type="text" name="sujet" />&nbsp;&nbsp;
			<label>Date: </label><input type="text" name="bdate" class="datepicker" id="datepicker1">&nbsp;&nbsp;
			<label>Nature:</label>
				<input type="radio" name="nature" id="nature" value="exprime" >Exprime</input>
				<input type="radio" name="nature" id="nature" value="non"/>Non Exprime<br><br>
			<h4>Action:</h4>
			<br>
				<label>Date de l'action: </label>
					<input type="text" name="adate" class="datepicker" id="datepicker2">
				<label>Date de l'alerte: </label>
					<input type="text" name="aldate" class="datepicker" id="datepicker3"><br><br>	
				<label>Etat: </label>
					<!-- must specify the combo box name <select name="etat" >-->
					<select name="etat">
						<option  value="ready">Ready</option>
						<option  value="transacting">Transacting</option>
						<option  value="finished"/>Finished</option>
					</select><br><br>
				<label>Detail: </label><br>
					<textarea rows="5" cols="40" name="adetail"></textarea>
				<br><br>
			<h4>Qualification: </h4>
			<br>
				<label>Date:  </label>
					<input type="text" name="qdate" class="datepicker" id="datepicker4"><br><br>
				<label>Detail: </label><br>
					<textarea rows="5" cols="40" name="qdetail"></textarea>
				<br><br>
			<h4>Proposition: </h4>
			<br>
				<label>Date: </label>
					<input type="text" name="pdate" class="datepicker" id="datepicker5" /><br><br>
				<label>Detail: </label><br>
					<textarea rows="5" cols="40" name="pdetail"></textarea>  
				<br><br>
			<label>Nom du decideur: </label>
				<input type="text"  name="decideur" />
			<br><br>
			<input type="submit" name="submit" value="submit"/>

process.php

<?php 
			$conne = mysql_connect($server, $user, $password) or die(mysql_error());
			mysql_select_db($db);
			/* insert values into table besoin */
			$query = "INSERT INTO besoin
					(sujet, bdate, nature, adate, aldate, etat, adetail, qdate, qdetail, pdate, pdetail, decideur)
					VALUES('".$_POST['sujet']."','".$_POST['bdate']."','".$_POST['nature']."','".$_POST['adate']."','".$_POST['aldate']."','".$_POST['etat']."',
					'".$_POST['adetail']."','".$_POST['qdate']."','".$_POST['qdetail']."','".$_POST['pdate']."','".$_POST['pdetail']."','".$_POST['decideur']."')";
			$result = mysql_query($query) or die("Query failed: ".mysql_error());
				if($result){
					echo "<p>Input data succeed!</p>";
				} else{
					echo "<p>Input data failed!</p>";
				}

Everytime, i sumbit the form.
There is how the result displayed:

bdate
0000-00-00

Does there anyone can help me???

Do i need to convert the text generated by datepicker to date format???

Thanks for your reponse.

function changueFormatDate($cdate){
    list($day,$month,$year)=explode("/",$cdate);
    return $year."-".$month."-".$day;
}  
/* How use */

$insertdate = changueFormatDate($postdate);

Greetings, Gabriel (url snipped)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.