Bonjour sebsauvage,
Tu as parfaitement raison, et je m'y mets, à mon rhytme, gentiment. Par exemple j'ai trouvé toute seule la formule pôur remplir en même temps tous les champs par l'intermédiaire d'excel, et j'en suis très fière !!!!
="INSERT INTO MARQUES (NOM_MARQUES,SITE_MARQUES,ID_GENRE,PAYS,NOTES,GENREANCIEN) VALUES ('"&A1&"','"&C1&"','','"&E1&"','"&I1&"','"&G1&"');"
pour moi c'est la preuve que j'avance !!
Mais j'ai maintenant un autre problème : j'ai fait cette page, et le menu genre ne s'affiche pas dans le navigateur, tu vois pourquoi stp ?
<?php require_once('../Connections/wimdb.php'); ?>
<?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 = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO marques (ID_marques, nom_marques, site_marques, ID_genre, pays, notes, genreancien) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID_marques'], "int"),
GetSQLValueString($HTTP_POST_VARS['nom_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['site_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['ID_genre'], "int"),
GetSQLValueString($HTTP_POST_VARS['pays'], "text"),
GetSQLValueString($HTTP_POST_VARS['notes'], "text"),
GetSQLValueString($HTTP_POST_VARS['genreancien'], "text"));
mysql_select_db($database_wimdb, $wimdb);
$Result1 = mysql_query($insertSQL, $wimdb) or die(mysql_error());
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO marques (ID_marques, nom_marques, site_marques, ID_genre, pays, notes, genreancien) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID_marques'], "int"),
GetSQLValueString($HTTP_POST_VARS['nom_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['site_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['ID_genre'], "int"),
GetSQLValueString($HTTP_POST_VARS['pays'], "text"),
GetSQLValueString($HTTP_POST_VARS['notes'], "text"),
GetSQLValueString($HTTP_POST_VARS['genreancien'], "text"));
mysql_select_db($database_wimdb, $wimdb);
$Result1 = mysql_query($insertSQL, $wimdb) or die(mysql_error());
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO marques (ID_marques, nom_marques, site_marques, ID_genre, pays, notes, genreancien) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID_marques'], "int"),
GetSQLValueString($HTTP_POST_VARS['nom_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['site_marques'], "text"),
GetSQLValueString($HTTP_POST_VARS['ID_genre'], "int"),
GetSQLValueString($HTTP_POST_VARS['pays'], "text"),
GetSQLValueString($HTTP_POST_VARS['notes'], "text"),
GetSQLValueString($HTTP_POST_VARS['genreancien'], "text"));
mysql_select_db($database_wimdb, $wimdb);
$Result1 = mysql_query($insertSQL, $wimdb) or die(mysql_error());
}
mysql_select_db($database_wimdb, $wimdb);
$query_rsGenre = "SELECT * FROM genre ORDER BY nom_genre ASC";
$rsGenre = mysql_query($query_rsGenre, $wimdb) or die(mysql_error());
$row_rsGenre = mysql_fetch_assoc($rsGenre);
$totalRows_rsGenre = mysql_num_rows($rsGenre);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/Templates/administration.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Document sans titre</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../prepare/styl-css/marq.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/www.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/alpha.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/chiffr.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/genre.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/foncolon.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/sommaire.css" rel="stylesheet" type="text/css">
<link href="../prepare/styl-css/fondgauch.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body bgcolor="#000000">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="100%" height="120" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="170" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="170" height="120" valign="middle"> <div align="center"><img src="../prepare/gif/arcwim.gif" width="170" height="120"></div></td>
</tr>
</table></td>
<td width="112" height="80" align="center" valign="middle"><img src="../prepare/gif/yam_fr.gif" width="112" height="80"></td>
<td width="468" align="center" valign="middle"><font color="#999999">pub
468x60</font></td>
</tr>
<tr>
<td height="40" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="580" height="40" valign="top"><img src="../prepare/gif/choose.gif" width="580" height="40"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="187" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="foncolon">
<!--DWLayoutTable-->
<tr> <!-- InstanceBeginEditable name="EditRegion3" -->
<td width="936" height="187" valign="top"><div align="center">
<p> </p>
<p> </p>
<p> </p>
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Nom_marques:</td>
<td><input type="text" name="nom_marques" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Site_marques:</td>
<td><input type="text" name="site_marques" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">ID_genre:</td>
<td> <select name="ID_genre">
<?php
do {
?>
<option value="<?php echo $row_rsGenre['nom_genre']?>" ><?php echo $row_rsGenre['ID_genre']?></option>
<?php
} while ($row_rsGenre = mysql_fetch_assoc($rsGenre));
?>
</select> </td>
<tr>
<tr valign="baseline">
<td nowrap align="right">Pays:</td>
<td><input type="text" name="pays" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Notes:</td>
<td><input type="text" name="notes" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Genreancien:</td>
<td><input type="text" name="genreancien" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insérer l'enregistrement"></td>
</tr>
</table>
<input type="hidden" name="ID_marques" value="">
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</div></td>
<!-- InstanceEndEditable --></tr>
</table></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($rsGenre);
?>