Mysqli_error() expects exactly 1 parameter
GIO0892
Messages postés
655
Statut
Membre
-
GIO0892 Messages postés 655 Statut Membre -
GIO0892 Messages postés 655 Statut Membre -
Bonjour,
voila j'ai cette erreur mais je ne trouve pas .
code :
la ligne 133 est :
dans :
merci .
voila j'ai cette erreur mais je ne trouve pas .
mysqli_error() expects exactly 1 parameter en ligne 133
code :
<?php
require_once('../lib/url_fonctions.php');
do_html_header('modifcation');
$conn=db_connect();
?>
<div id="corp">
<form method="post">
<tr align="center">
<td align="center">catégorie :</td>
<td>
<label for="choix" >
<select name="categorie" id="categorie">
<option value="0" ></option>
<option value="senior/homme" >senior/homme</option>
<option value="senior/femme" >senior/femme</option>
<option value="-20ans" >-20ans</option>
<option value="-17ans" >-17ans</option>
<option value="-15ans" >-15ans</option>
<option value="-13ans" >-13ans</option>
</select></label>
</td>
</tr>
<tr align="center">
<td>championnat :</td>
<td>
<label for="choix" >
<select name="championnat" id="championnat">
<option value="0" ></option>
<option value="promo honneur" >promo honneur</option>
<option value="honneur" >honneur</option>
</select></label>
</td>
</tr>
<input type="submit" />
</form>
<?php
// création des variable et récuperation des données
$categorie=$_POST['categorie'];
$champ=$_POST['championnat'];
// if aucune entré
if (!$categorie || !$champ){
echo'choose a championnat';
}
// sinon
else{
$result=$conn->query("select * from championnat where categorie='".$categorie."'")or die(mysqli_error());
// if aucun championnat valid
if (!$result){
echo'choisie un autre championnat car il n\'existe pas encore ,merci ';
}
// si il exite on affiche
if($result->num_rows>0) {
echo"<h2>Championnat:".$champ." </h2>" ;
echo"<h2>Catégorie:".$categorie."</h2>";
echo"<div id='result'>";
$result=$conn->query("select * from equipes where champ='".$champ."'")or die(mysqli_error());
echo '<form method="post">';
echo '<table width="500" border="3" cellpadding="5" cellspacing="0" bordercolor="#000000">';
echo '<tr bgcolor="#0000FF">';
echo '<th> </th>';
echo '<th> Equipe </th>';
echo '<th> J </th>';
echo '<th> victoire </th>';
echo '<th> nul </th>';
echo '<th> defaite </th>';
echo '<th> PTS </th>';
echo '<th> FOR </th>';
echo '<th> MAR </th>';
echo '<th> enc </th>';
echo '<th> pe </th>';
echo '<th>Obl </th>';
echo'<th>GA.P</th>';
$nb=0;
while($ligne=mysqli_fetch_array($result)) {
$nb++;
$nomequipe=$ligne['nomequipe'];
$j=$ligne['nbmatch'];
$v=$ligne['nbvictoire'];
$n=$ligne['nbnul'];
$d=$ligne['nbdefaite'];
$f=$ligne['nbforfait'];
$pts=$ligne['pts'];
$mar=$ligne['marquer'];
$enc=$ligne['enc'];
$pe=$ligne['pe'];
$obl=$ligne['Obl'];
$gap=$ligne['GA.P'];
echo '<tr>';
echo ' <td><input size="1" value="'.$nb.'" type="text" /></td>';
echo ' <td><input value="'.$nomequipe.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$j.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$v.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$n.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$d.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$f.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$pts.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$mar.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$enc.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$pe.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$obl.'" type="text" /></td>';
echo ' <td><input size="1" value="'.$gap.'" type="text" /></td>';
echo'</tr>';
}
echo'</table>';
echo '<input type="submit"/>';
echo'</from>';
$result=$conn->query("UPDATE equipes SET nomequipe='".$nomequipe."',
nbmatch='".$j."',
nbvictoire='".$v."',
nbnul='".$n."',
nbdefaite='".$d."',
nbforfait='".$f."',
pts='".$pts."',
marquer='".$mar."',
enc='".$enc."',
pe='".$pe."',
Obl='".$obl."',
GA.P='".$gap."'")or die(mysqli_error());
}
//sinon on demande de choisir un autre
else {
echo 'choisie une autre categorie ou championnat ';
}
}
?>
<br /><br /><br />
</div>
</div>
<?php
do_html_footer();
?>
la ligne 133 est :
GA.P='".$gap."'")or die(mysqli_error());
dans :
$result=$conn->query("UPDATE equipes SET nomequipe='".$nomequipe."',
nbmatch='".$j."',
nbvictoire='".$v."',
nbnul='".$n."',
nbdefaite='".$d."',
nbforfait='".$f."',
pts='".$pts."',
marquer='".$mar."',
enc='".$enc."',
pe='".$pe."',
Obl='".$obl."',
GA.P='".$gap."'")or die(mysqli_error());
merci .
A voir également:
- Mysqli_error() expects exactly 1 parameter
- TypeError: putpixel() takes exactly 3 positional arguments (5 gi ✓ - Forum Python
- Deprecated: str_replace(): passing null to parameter ✓ - Forum PHP
- Erreur!SQLSTATE[HY093]: Invalid parameter number: no parameters were bound ✓ - Forum PHP
- Alert hard drive self monitoring system has reported that a parameter has exceeded - Forum Windows 10
2 réponses
Salut, deja je pense qu'il y a une parenthèse en trop, essaie $result=$conn->query("UPDATE equipes SET nomequipe='".$nomequipe."', nbmatch='".$j."', nbvictoire='".$v."', nbnul='".$n."',nbdefaite='".$d."',nbforfait='".$f."', pts='".$pts."', marquer='".$mar."',enc='".$enc."',pe='".$pe."', Obl='".$obl."', GA.P='".$gap."'");