1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| mysql_select_db($database_connection, $connection);
$query_rsclient = sprintf("SELECT * FROM client WHERE Raison_sociale = '%s'", $colname_rsclient);
$rsclient = mysql_query($query_rsclient, $connection) or die(mysql_error());
$row_rsclient = mysql_fetch_assoc($rsclient);
$totalRows_rsclient = mysql_num_rows($rsclient);
if ($totalRows_rsclient>0)
{
$message = 'Ce client existe déjà. Modiffication impossible.';
//AppelPage('ajoutclient.php');
}
else
{
if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE client SET Raison_sociale=%s, Adresse=%s, telephone=%s, Gestionnaire=%s, Activite=%s WHERE NumCli=%s",
GetSQLValueString($HTTP_POST_VARS['raison'], "text"),
GetSQLValueString($HTTP_POST_VARS['adresse'], "text"),
GetSQLValueString($HTTP_POST_VARS['telephone'], "text"),
GetSQLValueString($HTTP_POST_VARS['gestionnaire'], "text"),
GetSQLValueString($HTTP_POST_VARS['activite'], "text"),
GetSQLValueString($HTTP_POST_VARS['NumCli'], "int"));
mysql_select_db($database_connection, $connection);
$Result1 = mysql_query($updateSQL, $connection) or die(mysql_error());
$updateGoTo = "gererclient.php"; |
Partager