iOniOn95 | Bonjour, voici mon pb: J'ai une table : ab_jourferm (date, code, libellé) donc la page renvoie le tableau avec ces 3 colonnes, et j'ai un bouton Ajouter (pour ajouter un type de jour fermé) [exemple : code : P libellé : Pont ou encore JF - Jour Fermé ) Et lorsque je fais ajouter, j'ai ce message : Fatal error: Call to undefined function GetSQLValueString() in C:\Program Files\EasyPHP-5.3.3\www\insert_jourferm.php on line 10
Voici le code :
jourferm.php
Code :
- <?php require_once('header.php'); ?>
- <?php
- mysql_select_db($database_Absences, $Absences);
- $query_AB_JOURFERM = "SELECT * FROM ab_jourferm";
- $AB_JOURFERM = mysql_query($query_AB_JOURFERM, $Absences) or die(mysql_error());
- $row_AB_JOURFERM = mysql_fetch_assoc($AB_JOURFERM);
- $totalRows_AB_JOURFERM = mysql_num_rows($AB_JOURFERM);
- mysql_select_db($database_Absences, $Absences);
- $query_list_jourferm = "SELECT * FROM ab_tjf";
- $list_jourferm = mysql_query($query_list_jourferm, $Absences) or die(mysql_error());
- $row_list_jourferm = mysql_fetch_assoc($list_jourferm);
- $totalRows_list_jourferm = mysql_num_rows($list_jourferm);
- ?>
- <p> </p>
- <p><br />
- </p>
- <table border="2" align="center">
- <tr>
- <td><div align="center" class="Style6" style="font-size: small; font-weight: bold">Date</div></td>
- <td><div align="center" class="Style6" style="font-size: small; font-weight: bold">Type</div></td>
- <td><div align="center" class="Style6" style="font-size: small; font-weight: bold">Action</div></td>
- </tr>
- <?php
- function iif($condition,$ok,$nok='') {
- print ($condition ? $ok : $nok);
- return ($condition ? $ok : $nok);
- }
- do {
- $i = 1;?>
- <form method="post" action="update_jourferm.php">
- <tr>
- <td><div align="center" class="Style5 Style5">
- <input name="AB_JOURFERM_DATE" type="text" value="<?php echo $row_AB_JOURFERM['AB_JOURFERM_DATE']; ?>" readonly="readonly" size="10" style="text-align:center"/>
- </div></td>
- <td><span class="Style5 Style5">
- <select name="AB_TJF_CODE">
- <?php
- do {
- ?>
- <option value="<?php echo $row_list_jourferm['AB_TJF_CODE']?>" <?php iif($row_list_jourferm['AB_TJF_CODE'] == $row_AB_JOURFERM['AB_TJF_CODE'],"Selected","" ) ?>><?php echo $row_list_jourferm['AB_TJF_LIBELLE']?></option>
- <?php
- } while ($row_list_jourferm = mysql_fetch_assoc($list_jourferm));
- $rows = mysql_num_rows($list_jourferm);
- if($rows > 0) {
- mysql_data_seek($list_jourferm, 0);
- $row_list_jourferm = mysql_fetch_assoc($list_jourferm);
- }
- ?>
- </select>
- </span> </td>
- <td>
- <div align="center" class="Style5 Style5">
- <input type="submit" name="update" id="update" value="Modifier" />
- <a href="delete_jourferm.php?AB_JOURFERM_DATE=<?php echo $row_AB_JOURFERM['AB_JOURFERM_DATE']; ?>">
- <input name="" type="checkbox" value="" />
- </a></div></td>
- </tr>
- </form>
- <?php $i=$i+1;} while ($row_AB_JOURFERM = mysql_fetch_assoc($AB_JOURFERM)); ?>
- </table>
- <br />
- <table align="center">
- <tr>
- <td><a href="insert_jourferm.php">
- <input type="submit" name="Ajouter" id="Ajouter" value="Ajouter" />
- </a>
- <a href="parametres.php">
- <input type="submit" name="Annuler" id="Annuler" value="Retour" />
- </a></td>
- </tr>
- </table>
- <p>
- <?php
- mysql_free_result($AB_JOURFERM);
- mysql_free_result($list_jourferm);
- ?>
- </p>
- <p> </p>
- <?php require_once('footer.php'); ?>
|
et insert_jourferm.php
Code :
- <?php require_once('header.php'); ?>
- <?php
- $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 ab_jourferm (AB_JOURFERM_DATE, AB_TJF_CODE, AB_JOURFERM_LIBELLE) VALUES (%s, %s, %s)",
- GetSQLValueString($_POST['AB_JOURFERM_DATE'], "date" ),
- GetSQLValueString($_POST['AB_TJF_CODE'], "text" ),
- GetSQLValueString($_POST['AB_JOURFERM_LIBELLE'], "text" ));
- mysql_select_db($database_Absences, $Absences);
- $Result1 = mysql_query($insertSQL, $Absences) or die(mysql_error());
- $insertGoTo = "jourferm.php";
- if (isset($_SERVER['QUERY_STRING'])) {
- $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
- $insertGoTo .= $_SERVER['QUERY_STRING'];
- }
- header(sprintf("Location: %s", $insertGoTo));
- }
- ?>
- <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
- <p> </p>
- <table align="center">
- <tr valign="baseline">
- <td nowrap="nowrap" align="right"><b>Date :</b></td>
- <td><input type="text" name="AB_JOURFERM_DATE" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right"><b>Code :</b></td>
- <td><input type="text" name="AB_TJF_CODE" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right"><b>Libellé :</b></td>
- <td><input type="text" name="AB_JOURFERM_LIBELLE" value="" size="32" /></td>
- </tr>
- <tr valign="baseline">
- <td nowrap="nowrap" align="right"> </td>
- <td>
- <div align="center"> <br />
- <input type="submit" value="Insérer" />
- <a href="jourferm.php">
- <input type="button" name="Retour" id="Retour" value="Retour" />
- </a></div></td>
- </tr>
- </table>
- <br />
- <input type="hidden" name="MM_insert" value="form1" />
- </form>
- <?php require_once('footer.php'); ?>
|
Je ne comprend pas ou est le problème, pourquoi m'affiche t-il Fatal error: Call to undefined function GetSQLValueString() in C:\Program Files\EasyPHP-5.3.3\www\insert_jourferm.php on line 10 Ligne 10 (ou il y a l'erreur) : GetSQLValueString($_POST['AB_JOURFERM_DATE'], "date" ),
Quelqu'un peut-il m'éclairer sur l'erreur qui s'affiche ?
Merci de bien vouloir m'aider
|