Test retour SQL

Écrit par Gandalf le . Publié dans Outils web

{source}

 

<html>

 

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>

 

<head>
# require_once('connection/inscriptions.php');

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$host_name = 'lmtr.myd.infomaniak.com';
$database = 'lmtr_cdtv2';
$user_name = 'lmtr_dominique';
$password = 'd186919m';
$bdd = mysqli_connect($host_name, $user_name, $password, $database);
?>
<?php
if (mysqli_connect_errno()) {
die('<p>La connexion au serveur MySQL a échoué: '.mysqli_connect_error().'</p>');
} else {
echo '<p>Liste des tireurs ayant réservé.</p >';
}
php?>
<?php
$var=$_GET[club];

$var="Brie";

echo "<br><br>get club : $_GET[club]<br>";

echo "var :$var<br>";

$resultat = mysqli_prepare($bdd, 'SELECT t1.first_name as Prenom,t1.last_name as Nom,t1.organization as Club,t1.state as Discipline,t2.title as Serie,t2.event_date as Date

FROM ersog_eb_registrants as t1

INNER JOIN ersog_eb_events as t2 on t1.event_id = t2.id

INNER JOIN ersog_eb_event_categories as t3 on t2.id=t3.event_id

INNER JOIN ersog_eb_categories as t4 on t3.category_id=t4.id

WHERE t1.organization = ?

AND event_date > now()

ORDER BY last_name, title,state');

mysqli_stmt_bind_param($resultat, "s", $var);
mysqli_stmt_execute($resultat);
mysqli_stmt_bind_result($resultat, $donnees['first_name'], $donnees['last_name'], $donnees['organization'], $donnees['state'], $donnees['title'], $donnees['event_date']);

mysqli_stmt_store_result($resultat);
$row_cnt = mysqli_stmt_num_rows($resultat);


php?>

</head>

<body>


<p>&nbsp;&nbsp;&nbsp; Lignes trouvées : <?php echo $row_cnt;?>&nbsp;lignes trouvées pour les réservations sur <?php echo $var;?></p>
<p>&nbsp; </p>
<table cellpadding="2" cellspacing="2" class="table-striped" style="width: 100%;">

<tr style="text-align: center">
<td width="30%" align="left" style="text-align: center">Nom prénom</td>
<td width="10%" align="left" style="text-align: center">Discipline</td>
<td width="35%" align="left" style="text-align: center">Serie</td>
<td width="30%" align="left" style="text-align: center">Date</td>
</tr><?
while (mysqli_stmt_fetch($resultat)) {
echo ('
<tr>
<td width="30%" align="left"> '.$donnees[first_name].' '.$donnees[last_name].'</td>
<td width="10%" align="left"> '.$donnees[state].'</td>
<td width="35%" align="left"> '.$donnees[title].'</td>
<td width="30%" align="left"> '.$donnees[event_date].'</td>
</tr>
');
}

php?>


</table>

 

<?php

echo "get club : $_GET[club]<br>";

echo "var :$var<br>";

$_GET[club]='';

echo "get club : $_GET[club]<br>";

echo "var :$var<br>";

echo "<br>";

php?>

</body>
</html>

{/source}