salut j'ai un souci.ayant php 5.5.12 je ne peut utiliser l'extension mysql. mais je ne sais pas comment utiliser mysqli_result si ca existe.regarder un peu ce code:
<html>
<head>
<meta charset="utf-7">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title> SPARK PROJECT </title>
<!-- Bootstrap -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/font-awesome.min.css" rel="stylesheet">
<!-- <link href="accueil.css" rel="stylesheet"> -->
<link href="reg.css" rel="stylesheet">
</head>
<body class="">
<!-- <nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"> SPARK </a>
</div>
<ul class="nav navbar-nav">
<li class=""><a href="entreprise.html"><i class="fa fa-pencil"></i> Planning </a></li> -->
<!-- <li class="dropdown" >
<a class="dropdown-toggle" data-toggle="dropdown" href="Intervention.html"> Intervention <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#"> Technicien </a></li></ul> -->
<!-- <li class=""><a href="Intervention.html"> Intervention </a></li>
<li class="">
<a class="dropdown-toggle" data-toggle="dropdown" href="client.html"> Clients <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#"> Sites </a></li>
<li><a href="#"> Equipements </a></li>
</li>
</ul>
<li class="active"><a href="facturation.php"> Facturation </a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="deconnexion.php"><span class="glyphicon glyphicon-user"></span> Deconnexion </a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login </a></li>
</ul> -->
<!-- <form class="navbar-form navbar-left" action="#">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form> -->
<!-- </div>
</nav> -->
<?php
include("includes/header.php");
include("includes/config.php");
$query="SELECT * FROM fiche ORDER BY nom ";
$result=$conn->query($query);
$num = mysqli_num_rows ($result);
$conn->close();
?>
<center>
<table border="0">
<tr>
<td class="titre">LISTE DES FICHES</td>
</tr>
</table>
<?php
if ($num > 0 ) {
$i=0;
while ($i < $num) {
$nom = mysql_result($result,$i,"nom");
$prenom = mysql_result($result,$i,"prenom");
$total = mysql_result($result,$i,"total");
$id = mysql_result($result,$i,"id");
$id = mysql_result($result,$i,"id");
?>
<table border="0"class="table" class="texte">
<tr>
<td><center><p class="texte">Mr, Mme <?php echo "$nom"; ?></center></td>
</tr>
</table>
<?php
echo "<p class=\"texte\"><b>N° :</b> $id<br>";
echo "<b>Nom :</b> $nom<br>";
echo "<b>Prenom :</b> $prenom<br>";
echo "<b>Tarif TTC :</b> $total<br>";
echo "<br><br>";
echo "</b></p>";
echo "<table border=\"0\" width=\"100%\">";
echo " <tr>";
echo " <td><p align=\"center\">";
echo " <a href=\"modif_fiche.php?id=$id\"><img border=\"0\" src=\"icones/edit.png\" width=\"48\" height=\"48\"><br>";
echo " Modifier Cette Fiche</a></td>";
echo " <td>";
echo " <td><p align=\"center\">";
echo " <a href=\"fiche.php?id=$id\"><img border=\"0\" src=\"icones/voir.png\" width=\"48\" height=\"48\"><br>";
echo " Voir La fiche</a></td>";
echo " <td>";
echo " <p align=\"center\">";
echo " <a href=\"suppr_fiche.php?id=$id\"><img border=\"0\" src=\"icones/suppr.png\" width=\"48\" height=\"48\"><br>";
echo " Supprimer Cette Fiche</a></td>";
echo " </tr>";
echo "</table>";
++$i; } } else { echo "La base de donnée est vide"; }
include("includes/footer.php");
?>
</body>
</html>
Afficher la suite
26 juil. 2018 à 00:55
26 juil. 2018 à 06:54
27 juil. 2018 à 10:09
27 juil. 2018 à 10:14
En même temps c'est normal.
Tu es passé à mysqli afin de remplacer les anciennes lignes de code "mysql_ "
Il faut nécessairement repasser sur TOUT le code qui utilisait l'ancienne extension afin de le mettre à jour via les "nouvelles" fonctions mysqli.
Pour le coup, ça donnerait un truc du genre
A remplacer, tout simplement, par :
27 juil. 2018 à 11:46