Problème Php&mysql
Kudo_shinichi
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
JooS Messages postés 2468 Date d'inscription Statut Membre Dernière intervention -
JooS Messages postés 2468 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
je veux groupé un résultat php d'une requête SQL sur plusieurs pages
Voici Mon Code, Merci :
<?php
$Activité = $_GET['Activité'];
$Ville = $_GET['Ville'];
$Search = $_GET['Search'];
if($Ville=='Tout'){
if($Activité=='Tout'){
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%'";
}else{
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Activité IN '{$Activité}'";
}
}else{
if($Activité=='Tout'){
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Ville IN '{$Ville}'";
}else{
$query="SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Ville IN '{$Ville}' AND Activité IN '{$Activité}'";
}
}
$result = mysql_query($query,$connection);
if($result === FALSE) {
die(mysql_error());
}
?>
<html>
<head>
<link href="stylesheets/public.css" media="all" rel = "stylesheet" type="text/css" />
</head>
<body>
<div id="Result">
<center>
<table>
<?php
while($row = mysql_fetch_array($result)){
echo "<tr><td>" ;
echo"{$row["Nom"]} <br />";
echo"{$row["Activité"]} <br />";
echo"{$row["Ville"]} <br />";
echo"{$row["Adresse"]} <br />";
echo"{$row["Tél"]} <br />";
echo "</td></tr>" ;
}
?>
je veux groupé un résultat php d'une requête SQL sur plusieurs pages
Voici Mon Code, Merci :
<?php
$Activité = $_GET['Activité'];
$Ville = $_GET['Ville'];
$Search = $_GET['Search'];
if($Ville=='Tout'){
if($Activité=='Tout'){
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%'";
}else{
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Activité IN '{$Activité}'";
}
}else{
if($Activité=='Tout'){
$query = "SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Ville IN '{$Ville}'";
}else{
$query="SELECT * FROM sociétés WHERE Visible=1 AND Nom LIKE '%{$Search}%' AND Ville IN '{$Ville}' AND Activité IN '{$Activité}'";
}
}
$result = mysql_query($query,$connection);
if($result === FALSE) {
die(mysql_error());
}
?>
<html>
<head>
<link href="stylesheets/public.css" media="all" rel = "stylesheet" type="text/css" />
</head>
<body>
<div id="Result">
<center>
<table>
<?php
while($row = mysql_fetch_array($result)){
echo "<tr><td>" ;
echo"{$row["Nom"]} <br />";
echo"{$row["Activité"]} <br />";
echo"{$row["Ville"]} <br />";
echo"{$row["Adresse"]} <br />";
echo"{$row["Tél"]} <br />";
echo "</td></tr>" ;
}
?>
A voir également:
- Problème Php&mysql
- Easy php - Télécharger - Divers Web & Internet
- Mysql community server - Télécharger - Bases de données
- Expert php pinterest - Télécharger - Langages
- Php alert - Forum PHP
- Mysql a répondu : documentation connexion impossible : paramètres incorrects. - Forum Bases de données