aureliemerlin
Messages postés82Date d'inscriptionjeudi 24 juin 2010StatutMembreDernière intervention17 avril 2013
-
17 nov. 2010 à 15:52
Le grand Jisay
Messages postés100Date d'inscriptionmardi 8 mai 2007StatutMembreDernière intervention18 février 2011
-
17 nov. 2010 à 17:15
Bonjour
Lorsque je crée un client je voudrais récupérer son numéro pour l'insérer dans un champ de la même table
voici le code que je fais mais j'arrive à créer mon client mais je n'arrive pas à récupérer mon numéro et effectuer ma requête de MAJ :
<doctype html public "-//w3c//dtd xhtml 1.0 strcit//en"
"http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml/lang="fr"
lang="fr"
<head>
<META HTTP-equiv="content-type"
content="text/html, charset=utf-8"/>
</head>
if (!mysqli_query($lien, $sql))
{
$sql1 ="SELECT LAST_INSERT_ID(Num) FROM bdclient";
$sql = "UPDATE bdclient set NumCli='$sql1' where NumCli IS NULL";
if (!mysqli_query($lien, $sql))
{
$erreur = "erreur dans l ajout du client :" .mysqli_error($lien);
include 'erreur.html.php';
exit();
}
}
header('Location: http://gescompt/listeclients.php', true, 303);
exit();
}
?>
<?php
function changedatefrus($datefr)
{
$dateus=$datefr{6}.$datefr{7}.$datefr{8}.$datefr{9}."-".$datefr{3}.$datefr{4}."-".$datefr{0}.$datefr{1};
return $dateus;
}
?>
</html>
quelqu'un a t il une idée???
merci d'avance
Aurélie