Tjs un pb avec CURRENT_DATE et dreamweaver

WRInaute discret
Bonjour,

J'ai tjs un pb avec CURRENT DATE. Voila :

Je développe un site et lors de l'enregistrement des membres, je veux que la date du jour d'inscription s'insere automatiquement. Je sais qu'il faut utiliser CURRENT_DATE() pour cela mais j'ai beau l'intégrer dans le code généré par DREAMWEAVER et cela ne fonctionne pas !

Si qqu'un pouvait m'aider ! ! ! ! Voici le code et je ne sais plus que faire ou quoi modifier :

<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO inscription_db (ID, dateInscription, nom, prenom, nom_com, statut, adresse, cp, ville, region1, region2, dpt, dpt2, dpt3, tel1, tel2, mail, site, prestation1, prestation2, prestation3, pict, mdp, dateNaissance, contratsObtenus, valid) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['dateInscription'], "date"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['prenom'], "text"),
GetSQLValueString($_POST['nom_com'], "text"),
GetSQLValueString($_POST['statut'], "text"),
GetSQLValueString($_POST['adresse'], "text"),
GetSQLValueString($_POST['cp'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['region1'], "text"),
GetSQLValueString($_POST['region2'], "text"),
GetSQLValueString($_POST['dpt'], "text"),
GetSQLValueString($_POST['dpt2'], "text"),
GetSQLValueString($_POST['dpt3'], "text"),
GetSQLValueString($_POST['tel1'], "text"),
GetSQLValueString($_POST['tel2'], "text"),
GetSQLValueString($_POST['mail'], "text"),
GetSQLValueString($_POST['site'], "text"),
GetSQLValueString($_POST['prestation1'], "text"),
GetSQLValueString($_POST['prestation2'], "text"),
GetSQLValueString($_POST['prestation3'], "text"),
GetSQLValueString($_POST['pict'], "text"),
GetSQLValueString($_POST['mdp'], "text"),
GetSQLValueString($_POST['dateNaissance'], "text"),
GetSQLValueString($_POST['contratsObtenus'], "text"),
GetSQLValueString($_POST['valid'], "text"));

mysql_select_db($database_animus, $animus);
$Result1 = mysql_query($insertSQL, $animus) or die(mysql_error());

$insertGoTo = "inscription_ok.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO inscription_db (ID, dateInscription, nom, prenom, nom_com, statut, adresse, cp, ville, pays, region1, region2, dpt, dpt2, dpt3, tel1, tel2, mail, site, prestation1, prestation2, prestation3, slogan, pict, mdp, dateNaissance, contratsObtenus, valid) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['dateInscription'], "date"),
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['prenom'], "text"),
GetSQLValueString($_POST['nom_com'], "text"),
GetSQLValueString($_POST['statut'], "text"),
GetSQLValueString($_POST['adresse'], "text"),
GetSQLValueString($_POST['cp'], "text"),
GetSQLValueString($_POST['ville'], "text"),
GetSQLValueString($_POST['pays'], "text"),
GetSQLValueString($_POST['region1'], "text"),
GetSQLValueString($_POST['region2'], "text"),
GetSQLValueString($_POST['dpt'], "text"),
GetSQLValueString($_POST['dpt2'], "text"),
GetSQLValueString($_POST['dpt3'], "text"),
GetSQLValueString($_POST['tel1'], "text"),
GetSQLValueString($_POST['tel2'], "text"),
GetSQLValueString($_POST['mail'], "text"),
GetSQLValueString($_POST['site'], "text"),
GetSQLValueString($_POST['prestation1'], "text"),
GetSQLValueString($_POST['prestation2'], "text"),
GetSQLValueString($_POST['prestation3'], "text"),
GetSQLValueString($_POST['slogan'], "text"),
GetSQLValueString($_POST['pict'], "text"),
GetSQLValueString($_POST['mdp'], "text"),
GetSQLValueString($_POST['dateNaissance'], "text"),
GetSQLValueString($_POST['contratsObtenus'], "text"),
GetSQLValueString($_POST['valid'], "text"));

mysql_select_db($database_animus, $animus);
$Result1 = mysql_query($insertSQL, $animus) or die(mysql_error());
}
?>

merci beaucoup d'avance
 
WRInaute impliqué
Rien que cela, ça fait frémir :
Code:
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
Sinon je ne vois pas de CURRENT_DATE() dans ton code.
 
WRInaute accro
remplace dans ton code:
GetSQLValueString($_POST['dateInscription'], "date")

par: ( tu as 3 choix possible)

- date + heure
NOW() ou CURRENT_TIMESTAMP()
- date
CURRENT_DATE()
 

➡️ Offre MyRankingMetrics ⬅️

pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)

Voir les détails ici

coaching SEO
Discussions similaires
Haut