8796 sujets

Développement web côté serveur, CMS

Bonjour,

J'essay de vous exposer mon problème de la manière la plus claire possible et je remercie d'avance celles ou ceux qui pourront m'aider à le résoudre, car je n'arrive pas à le résoudre depuis quelques jours déjà :

J'ai créé une première page contenant un formulaire de recherche comportant les champs suivants :

Pays éligible (paysel) - liste déroulante
Région éligible (regel) - liste déroulante
Département éligible (depel) - liste déroulante
Partenariat international ou européen - liste déroulante - oui/non
Nature du porteur de projet - liste déroulante
Thématique couverte par le projet - liste déroulante
Sous-thématique couverte par le projet - liste déroulante

L'utilisateur doit pouvoir effectuer sa recherche en utilisant un, deux, plusieurs ou tous les critères de recherche (listes déroulantes)

Lorsqu'il lance la recherche, une seconde page s'ouvre qui est censée lui donner le résultat de sa recherche.

Les variables passent sans problème (print_r), néanmoins aucun résultat n'apparaît dans mon région répétée.

Je vous laisse le code de ma page ci-après en vous remerciant par avance pour vos conseils et suggestions.

Bill



<?php require_once('../../Connections/viaregio.php'); ?>
<?php mysql_query("SET NAMES 'UTF8'"); ?>
<?php
	
	// VERIFIER QUE LES VARIABLES GET PASSENT BIEN
	print_r($_GET);
	
?>
<?php
 
	// RECUPERER LES VARIABLES DE LA PAGE PRECEDENTE
 
	$paysel    	= $_GET['paysel'];
	$regel    	= $_GET['regel'];
	$depel    	= $_GET['depel'];
	$parteu    	= $_GET['parteu'];
	$benpot    	= $_GET['benpot'];
	$themact    = $_GET['themact'];
	$sthemact	= $_GET['sthemact'];
 
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
mysql_select_db($database_viaregio, $viaregio);
$query_res_niveau_4int = "SELECT * FROM niveau_4 WHERE paysel = $paysel OR regel = $regel OR depel = $depel OR parteu = $parteu OR benpot = $benpot OR themact = $themact OR sthemact = $sthemact";
$res_niveau_4int = mysql_query($query_res_niveau_4int, $viaregio) or die(mysql_error());
$row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int);
$totalRows_res_niveau_4int = mysql_num_rows($res_niveau_4int);
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rechercher une source de financement</title>
<link href="fds_assearch.css" rel="stylesheet" type="text/css" />
<script src="../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="../../spryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="css/bd_if_search.css" rel="stylesheet" type="text/css" />
 
</head>
 
<body class="twoColFixLtHdr">
 
  <div id="Results">
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0" style="font-family:'Trebuchet MS'; font-size:11px">Internationaux
<?php 
$resultat = mysql_num_rows($res_niveau_4int);
echo "$resultat résultats\n";
?>
</li>
</ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">
          <table width="100%" border="0">
  <tr class="res_title">
    <td scope="row">nomact</td>
    <td>paysel</td>
    <td>regel</td>
    <td>depel</td>
    <td>parteu</td>
    <td>benpot</td>
    <td>themact</td>
    <td>sthemact</td>
    <td>Détails</td>
  </tr>
  <?php do { ?>
    <form action="fds_intdetails.php" id="intrepint" name="intrepint" method="get">
      <tr class="res_list">
        <td scope="row"><input name="id_niv4" type="hidden" id="id_niv4" value="<?php echo $row_res_niveau_4int['id_niv4']; ?>" />
          <?php echo $row_res_niveau_4int['nomact']; ?></td>
        <td><?php echo $row_res_niveau_4int['paysel']; ?></td>
        <td><?php echo $row_res_niveau_4int['regel']; ?></td>
        <td><?php echo $row_res_niveau_4int['depel']; ?></td>
        <td><?php echo $row_res_niveau_4int['parteu']; ?></td>
        <td><?php echo $row_res_niveau_4int['benpot']; ?></td>
        <td><?php echo $row_res_niveau_4int['themact']; ?></td>
        <td><?php echo $row_res_niveau_4int['sthemact']; ?></td>
        <td><input type="image" src="../../images/icones/Computer.png" width="15" height="15" name="submit" id="submit" value="fiche IF" /></td>
      </tr></form>
    <?php } while ($row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int)); ?>
          </table>
        </div>
</div>
    </div>
  <!-- fin de #Results --></div>
  <div id="Results">&nbsp;</div>
    	<!-- Cet élément de suppression doit suivre immédiatement l'élément div #mainContent afin de forcer l'élément div #container à contenir tous les éléments flottants enfants --><br class="clearfloat" />
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($res_niveau_4int);
?>



Modifié par billledouble (30 Jun 2010 - 15:41)
Salut,

Y a pas grand chose sur le code que tu nous donnes qui puisse nous aider à t'aider ... D'autant que ton explication n'est pas des plus claire.
Salut,

Merci pour ton feedback,

tu trouveras ci-après le code de la 1ère page contenant le moteur de recherche, puis la seconde page sensée lister dans une zone répétée le résultat de ma recherche.

Je souhaiterais pouvoir choisir un, plusieurs ou tous les critères et que ma requête me liste les records correspondants.

Par exemple si je choisi comme pays (paysel) l'Afghanistan, il me liste tous les records de la base, alors qu'il ne devrait me lister que les records correspondants à la valeur 35 (Afghanistan) et non également les records des autres pays.

Si je choisis la France comme pays (paysel) et comme porteur de projet potentiel (benpot) la France et les associations et ONG, il me retourne également tous les records.

Bref, je crois que j'ai un problème avec ma requête SQL, car les champs et leur contenu sont ok.

Ci-après ma requête si tu pourrais jeter un coup d'oeil et m'aiguiller ce serait génial, car là je n'avance plus. Je te laisse également après la requête le code des deux pages (moteur de recherche et résultat de la recherche). Merci d'avance de ton aide, ciao


mysql_select_db($database_viaregio, $viaregio);
$query_res_niveau_4int = "SELECT * FROM niveau_4 WHERE paysel = $paysel OR regel = $regel OR depel = $depel OR parteu = $parteu OR benpot = $benpot OR themact = $themact OR sthemact = $sthemact";
$res_niveau_4int = mysql_query($query_res_niveau_4int, $viaregio) or die(mysql_error());
$row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int);
$totalRows_res_niveau_4int = mysql_num_rows($res_niveau_4int);


CODE DE LA 1ERE PAGE

<?php require('../../connections/viaregio.php'); ?>
<?php mysql_query("SET NAMES 'UTF8'"); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}


// TABLES NECESSAIRES AUX LISTES DEROULANTES

mysql_select_db($database_viaregio, $viaregio);
$query_r_pays = "SELECT * FROM lstpays ORDER BY ordre ASC";
$r_pays = mysql_query($query_r_pays, $viaregio) or die(mysql_error());
$row_r_pays = mysql_fetch_assoc($r_pays);
$totalRows_r_pays = mysql_num_rows($r_pays);

mysql_select_db($database_viaregio, $viaregio);
$query_r_regel = "SELECT * FROM lstregion ORDER BY id_region ASC";
$r_regel = mysql_query($query_r_regel, $viaregio) or die(mysql_error());
$row_r_regel = mysql_fetch_assoc($r_regel);
$totalRows_r_regel = mysql_num_rows($r_regel);

mysql_select_db($database_viaregio, $viaregio);
$query_r_depel = "SELECT * FROM lstdept ORDER BY id_dept ASC";
$r_depel = mysql_query($query_r_depel, $viaregio) or die(mysql_error());
$row_r_depel = mysql_fetch_assoc($r_depel);
$totalRows_r_depel = mysql_num_rows($r_depel);

mysql_select_db($database_viaregio, $viaregio);
$query_r_parteu = "SELECT * FROM lstparteu";
$r_parteu = mysql_query($query_r_parteu, $viaregio) or die(mysql_error());
$row_r_parteu = mysql_fetch_assoc($r_parteu);
$totalRows_r_parteu = mysql_num_rows($r_parteu);

mysql_select_db($database_viaregio, $viaregio);
$query_r_benpot = "SELECT * FROM lstben ORDER BY id_ben ASC";
$r_benpot = mysql_query($query_r_benpot, $viaregio) or die(mysql_error());
$row_r_benpot = mysql_fetch_assoc($r_benpot);
$totalRows_r_benpot = mysql_num_rows($r_benpot);

mysql_select_db($database_viaregio, $viaregio);
$query_r_themact = "SELECT * FROM lstthem ORDER BY id_them ASC";
$r_themact = mysql_query($query_r_themact, $viaregio) or die(mysql_error());
$row_r_themact = mysql_fetch_assoc($r_themact);
$totalRows_r_themact = mysql_num_rows($r_themact);

mysql_select_db($database_viaregio, $viaregio);
$query_r_sthemact = "SELECT * FROM lstthemsous ORDER BY id_themsous ASC";
$r_sthemact = mysql_query($query_r_sthemact, $viaregio) or die(mysql_error());
$row_r_sthemact = mysql_fetch_assoc($r_sthemact);
$totalRows_r_sthemact = mysql_num_rows($r_sthemact);

mysql_select_db($database_viaregio, $viaregio);
$query_r_niveau_4 = "SELECT * FROM niveau_4";
$r_niveau_4 = mysql_query($query_r_niveau_4, $viaregio) or die(mysql_error());
$row_r_niveau_4 = mysql_fetch_assoc($r_niveau_4);
$totalRows_r_niveau_4 = mysql_num_rows($r_niveau_4);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rechercher une source de financement</title>
<link href="fds_assearch.css" rel="stylesheet" type="text/css" />
<link href="css/bd_if_search.css" rel="stylesheet" type="text/css" />

</head>

<body class="twoColFixLtHdr">

<div id="mainContent">
        <form action="testget.php" method="get" name="search" id="search">
<table width="100%" border="0" cellspacing="0" class="police_search ">
  <tr>
    <td colspan="2" bordercolor="#f1f1f1" scope="row">Lieu de réalisation du projet</td>
    <td> </td>
    <td colspan="2" bordercolor="#f1f1f1"> </td>
  </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row">Pays</td>
    <td width="0" bordercolor="#f1f1f1"><select style="font-size:10px; width:400px" name="paysel" id="paysel">
          <?php
do {  
?><option value="<?php echo $row_r_pays['id_pays']?>"><?php echo $row_r_pays['pays']?></option>
      <?php
} while ($row_r_pays = mysql_fetch_assoc($r_pays));
  $rows = mysql_num_rows($r_pays);
  if($rows > 0) {
      mysql_data_seek($r_pays, 0);
	  $row_r_pays = mysql_fetch_assoc($r_pays);
  }
?>
    </select>    </td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"><img src="../../images/icones/Database.png" width="20" height="20" /></td>
    <td width="0" bordercolor="#f1f1f1">
    <?php
		$res = mysql_query('SELECT COUNT(*) AS total FROM niveau_4') OR die(mysql_error());
		$row = mysql_fetch_assoc($res);
		echo $row['total'];
	?>
    </td>
    </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row">Région</td>
    <td width="0" bordercolor="#f1f1f1"><select style="font-size:10px; width:400px" name="regel" id="regel">
      <?php
do {  
?><option value="<?php echo $row_r_regel['id_region']?>"><?php echo $row_r_regel['region']?></option>
      <?php
} while ($row_r_regel = mysql_fetch_assoc($r_regel));
  $rows = mysql_num_rows($r_regel);
  if($rows > 0) {
      mysql_data_seek($r_regel, 0);
	  $row_r_regel = mysql_fetch_assoc($r_regel);
  }
?>
    </select>    </td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"><img src="../../images/icones/Calender.png" alt="" width="20" height="20" /></td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
    <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row">Département</td>
    <td width="0" bordercolor="#f1f1f1"><select style="font-size:10px; width:400px" name="depel" id="depel">
      <?php
do {  
?>
      <option value="<?php echo $row_r_depel['id_dept']?>"<?php if (!(strcmp($row_r_depel['id_dept'], $row_r_depel['id_region']))) {echo "selected=\"selected\"";} ?>><?php echo $row_r_depel['dept']?></option>
      <?php
} while ($row_r_depel = mysql_fetch_assoc($r_depel));
  $rows = mysql_num_rows($r_depel);
  if($rows > 0) {
      mysql_data_seek($r_depel, 0);
	  $row_r_depel = mysql_fetch_assoc($r_depel);
  }
?>
    </select>    </td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
          <tr>
    <td scope="row">Allez-vous mener ce projet dans le cadre d'un partenariat européen ou international ?      </td>
    <td scope="row"><select style="font-size:10px" name="parteu" id="parteu">
      <?php
do {  
?>
      <option value="<?php echo $row_r_parteu['id_parteu']?>"><?php echo $row_r_parteu['parteu']?></option>
      <?php
} while ($row_r_parteu = mysql_fetch_assoc($r_parteu));
  $rows = mysql_num_rows($r_parteu);
  if($rows > 0) {
      mysql_data_seek($r_parteu, 0);
	  $row_r_parteu = mysql_fetch_assoc($r_parteu);
  }
?>
    </select></td>
    <td width="0"> </td>
    <td> </td>
    <td width="0"> </td>
    </tr>
      <tr>
    <td width="0" scope="row"> </td>
    <td width="0"> </td>
    <td width="0"> </td>
    <td> </td>
    <td width="0"> </td>
    </tr>
      <tr>
    <td width="0" scope="row">Identification du porteur de projet</td>
    <td width="0"> </td>
    <td width="0"> </td>
    <td> </td>
    <td width="0"> </td>
    </tr>
      <tr>
    <td width="0" scope="row">Nature du porteur de projet</td>
    <td width="0"><select style="font-size:10px; width:400px" name="benpot" id="benpot">
      <?php
do {  
?>
      <option value="<?php echo $row_r_benpot['id_ben']?>"><?php echo $row_r_benpot['ben']?></option>
      <?php
} while ($row_r_benpot = mysql_fetch_assoc($r_benpot));
  $rows = mysql_num_rows($r_benpot);
  if($rows > 0) {
      mysql_data_seek($r_benpot, 0);
	  $row_r_benpot = mysql_fetch_assoc($r_benpot);
  }
?>
    </select></td>
    <td width="0"> </td>
    <td> </td>
    <td width="0"> </td>
    </tr>
        <tr>
      <td colspan="2" bordercolor="#f1f1f1" scope="row"> </td>
      <td> </td>
      <td bordercolor="#f1f1f1"> </td>
      <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
    <tr>
      <td colspan="2" bordercolor="#f1f1f1" scope="row">Domaine d'intervention du projet</td>
      <td> </td>
      <td bordercolor="#f1f1f1"> </td>
      <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row">Thématique couverte par le projet</td>
    <td width="0" bordercolor="#f1f1f1"><select name="themact" id="themact" style="font-size:10px; width:400px">
      <?php
do {  
?>
      <option value="<?php echo $row_r_themact['id_them']?>"><?php echo $row_r_themact['them']?></option>
      <?php
} while ($row_r_themact = mysql_fetch_assoc($r_themact));
  $rows = mysql_num_rows($r_themact);
  if($rows > 0) {
      mysql_data_seek($r_themact, 0);
	  $row_r_themact = mysql_fetch_assoc($r_themact);
  }
?>
    </select></td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row">Sous-thématique couverte par le projet</td>
    <td width="0" bordercolor="#f1f1f1"><select style="font-size:10px; width:400px" name="sthemact" id="sthemact">
      <?php
do {  
?>
      <option value="<?php echo $row_r_sthemact['id_themsous']?>"><?php echo $row_r_sthemact['themsous']?></option>
      <?php
} while ($row_r_sthemact = mysql_fetch_assoc($r_sthemact));
  $rows = mysql_num_rows($r_sthemact);
  if($rows > 0) {
      mysql_data_seek($r_sthemact, 0);
	  $row_r_sthemact = mysql_fetch_assoc($r_sthemact);
  }
?>
    </select></td>
    <td width="0"> </td>
    <td bordercolor="#f1f1f1"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    </tr>
  <tr>
    <td width="0" bordercolor="#f1f1f1" scope="row"> </td>
    <td width="0" bordercolor="#f1f1f1"> </td>
    <td width="0"> </td>
    <td> </td>
    <td width="0"> </td>
  </tr>
  <tr>
    <td width="0" scope="row"> </td>
    <td width="0"> </td>
    <td width="0"> </td>
    <td> </td>
    <td width="0" align="right"><input type="submit" name="submit" id="submit" value="Rechercher" style=" vertical-align:right; background-color: #CCC; border:#666; border-style: solid; border-width:thin; color: #000; font-size:10px"" /></td>
  </tr>
</table>
</form>

   	  <!-- fin de #mainContent --></div>
  <div id="Results">
<!-- fin de #Results --></div>
  <div id="Results"> </div>

    	<!-- Cet élément de suppression doit suivre immédiatement l'élément div #mainContent afin de forcer l'élément div #container à contenir tous les éléments flottants enfants --><br class="clearfloat" />
</body>
</html>
<?php
mysql_free_result($r_parteu);

mysql_free_result($r_pays);

mysql_free_result($r_regel);

mysql_free_result($r_depel);

mysql_free_result($r_benpot);

mysql_free_result($r_themact);

mysql_free_result($r_sthemact);

mysql_free_result($r_niveau_4);
?>





<?php require_once('../../Connections/viaregio.php'); ?>
<?php mysql_query("SET NAMES 'UTF8'"); ?>
<?php
	
	// VERIFIER QUE LES VARIABLES GET PASSENT BIEN
	print_r($_GET);
	
?>
<?php

	// RECUPERER LES VARIABLES

	$paysel    	= $_GET['paysel'];
	$regel    	= $_GET['regel'];
	$depel    	= $_GET['depel'];
	$parteu    	= $_GET['parteu'];
	$benpot    	= $_GET['benpot'];
	$themact    = $_GET['themact'];
	$sthemact	= $_GET['sthemact'];

?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_viaregio, $viaregio);
$query_res_niveau_4int = "SELECT * FROM niveau_4 WHERE paysel = $paysel OR regel = $regel OR depel = $depel OR parteu = $parteu OR benpot = $benpot OR themact = $themact OR sthemact = $sthemact";
$res_niveau_4int = mysql_query($query_res_niveau_4int, $viaregio) or die(mysql_error());
$row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int);
$totalRows_res_niveau_4int = mysql_num_rows($res_niveau_4int);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rechercher une source de financement</title>
<link href="fds_assearch.css" rel="stylesheet" type="text/css" />
<script src="../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="../../spryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="css/bd_if_search.css" rel="stylesheet" type="text/css" />

</head>

<body class="twoColFixLtHdr">

  <div id="Results">
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0" style="font-family:'Trebuchet MS'; font-size:11px">Internationaux
<?php 
$resultat = mysql_num_rows($res_niveau_4int);
echo "$resultat résultats\n";
?>
</li>
</ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">
          <table width="100%" border="0">
  <tr class="res_title">
    <td scope="row">nomact</td>
    <td>paysel</td>
    <td>regel</td>
    <td>depel</td>
    <td>parteu</td>
    <td>benpot</td>
    <td>themact</td>
    <td>sthemact</td>
    <td>Détails</td>
  </tr>
  <?php do { ?>
    <form action="fds_intdetails.php" id="intrepint" name="intrepint" method="get">
      <tr class="res_list">
        <td scope="row"><input name="id_niv4" type="hidden" id="id_niv4" value="<?php echo $row_res_niveau_4int['id_niv4']; ?>" />
          <?php echo $row_res_niveau_4int['nomact']; ?></td>
        <td><?php echo $row_res_niveau_4int['paysel']; ?></td>
        <td><?php echo $row_res_niveau_4int['regel']; ?></td>
        <td><?php echo $row_res_niveau_4int['depel']; ?></td>
        <td><?php echo $row_res_niveau_4int['parteu']; ?></td>
        <td><?php echo $row_res_niveau_4int['benpot']; ?></td>
        <td><?php echo $row_res_niveau_4int['themact']; ?></td>
        <td><?php echo $row_res_niveau_4int['sthemact']; ?></td>
        <td><input type="image" src="../../images/icones/Computer.png" width="15" height="15" name="submit" id="submit" value="fiche IF" /></td>
      </tr></form>
    <?php } while ($row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int)); ?>
          </table>
        </div>
</div>
    </div>
  <!-- fin de #Results --></div>
  <div id="Results"> </div>
    	<!-- Cet élément de suppression doit suivre immédiatement l'élément div #mainContent afin de forcer l'élément div #container à contenir tous les éléments flottants enfants --><br class="clearfloat" />
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($res_niveau_4int);
?>

J'ai retravaillé la page résultat, mais toujours sans succès. Ma requête n'arrive toujours pas à retourner les bons records.


<?php require_once('../../Connections/viaregio.php'); ?>
<?php mysql_query("SET NAMES 'UTF8'"); ?>
<?php
	
	// VERIFIER QUE LES VARIABLES GET PASSENT BIEN
	
	echo "<pre>";
	print_r($_GET);
	echo "</pre>";	
	
?>
<?php


// DANS $WHERE ON INSERE LA CLAUSE WHERE DE LA REQUETE,
// CETTE CLAUSE DEPEND DES VARIABLES RENVOYEES PAR LE 
// FORMULAIRE

$where = "";

// SI L'UTILISATEUR A SPECIFIE LE PAYS, ON CREE LA CLAUSE 
// WHERE AVEC PAYSEL
if(isset($paysel) and $paysel != null)
   $where = "WHERE paysel = '$paysel'";

// SI L'UTILISATEUR A SPECIFIE LA REGION, ON CREE LA CLAUSE 
// WHERE AVEC REGEL
if(isset($regel) and $regel != null and $where != "")
{
   $where = " AND regel = '$regel'";
}

// SI L'UTILISATEUR A SPECIFIE LE DEPARTEMENT, ON CREE LA CLAUSE 
// WHERE AVEC DEPEL
if(isset($depel) and $depel != null and $where != "")
{
   $where = " AND depel = '$depel'";
}

// SI L'UTILISATEUR A SPECIFIE LA POSSIBILITE D'UN PARTENARIAT, ON CREE LA CLAUSE 
// WHERE AVEC PARTEU
if(isset($parteu) and $parteu != null and $where != "")
{
   $where = " AND parteu = '$parteu'";
}

// SI L'UTILISATEUR A SPECIFIE LA POSSIBILITE D'UN PARTENARIAT, ON CREE LA CLAUSE 
// WHERE AVEC PARTEU
if(isset($parteu) and $parteu != null and $where != "")
{
   $where = " AND parteu = '$parteu'";
}

// SI L'UTILISATEUR A SPECIFIE LA POSSIBILITE D'UN PARTENARIAT, ON CREE LA CLAUSE 
// WHERE AVEC BENPOT
if(isset($benpot) and $benpot != null and $where != "")
{
   $where = " AND benpot = '$benpot'";
}

// SI L'UTILISATEUR A SPECIFIE LA POSSIBILITE D'UN PARTENARIAT, ON CREE LA CLAUSE 
// WHERE AVEC THEMACT
if(isset($themact) and $themact != null and $where != "")
{
   $where = " AND themact = '$themact'";
}

// SI L'UTILISATEUR A SPECIFIE LA POSSIBILITE D'UN PARTENARIAT, ON CREE LA CLAUSE 
// WHERE AVEC STHEMACT
if(isset($sthemact) and $sthemact != null and $where != "")
{
   $where = " AND sthemact = '$sthemact'";
}

?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_viaregio, $viaregio);
$query_res_niveau_4int = "SELECT * FROM niveau_4 $where";
$res_niveau_4int = mysql_query($query_res_niveau_4int, $viaregio) or die(mysql_error());
$row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int);
$totalRows_res_niveau_4int = mysql_num_rows($res_niveau_4int);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Rechercher une source de financement</title>
<link href="fds_assearch.css" rel="stylesheet" type="text/css" />
<script src="../../SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="../../spryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link href="css/bd_if_search.css" rel="stylesheet" type="text/css" />

</head>

<body class="twoColFixLtHdr">

  <div id="Results">
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0" style="font-family:'Trebuchet MS'; font-size:11px">Internationaux
<?php 
$resultat = mysql_num_rows($res_niveau_4int);
echo "$resultat résultats\n";
?>
</li>
</ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">
          <table width="100%" border="0">
  <tr class="res_title">
    <td scope="row">nomact</td>
    <td>paysel</td>
    <td>regel</td>
    <td>depel</td>
    <td>parteu</td>
    <td>benpot</td>
    <td>themact</td>
    <td>sthemact</td>
    <td>Détails</td>
  </tr>
  <?php do { ?>
    <form action="fds_intdetails.php" id="intrepint" name="intrepint" method="get">
      <tr class="res_list">
        <td scope="row"><input name="id_niv4" type="hidden" id="id_niv4" value="<?php echo $row_res_niveau_4int['id_niv4']; ?>" />
          <?php echo $row_res_niveau_4int['nomact']; ?></td>
        <td><?php echo $row_res_niveau_4int['paysel']; ?></td>
        <td><?php echo $row_res_niveau_4int['regel']; ?></td>
        <td><?php echo $row_res_niveau_4int['depel']; ?></td>
        <td><?php echo $row_res_niveau_4int['parteu']; ?></td>
        <td><?php echo $row_res_niveau_4int['benpot']; ?></td>
        <td><?php echo $row_res_niveau_4int['themact']; ?></td>
        <td><?php echo $row_res_niveau_4int['sthemact']; ?></td>
        <td><input type="image" src="../../images/icones/Computer.png" width="15" height="15" name="submit" id="submit" value="fiche IF" /></td>
      </tr></form>
    <?php } while ($row_res_niveau_4int = mysql_fetch_assoc($res_niveau_4int)); ?>
          </table>
        </div>
</div>
    </div>
  <!-- fin de #Results --></div>
  <div id="Results"> </div>
    	<!-- Cet élément de suppression doit suivre immédiatement l'élément div #mainContent afin de forcer l'élément div #container à contenir tous les éléments flottants enfants --><br class="clearfloat" />
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
<?php
mysql_free_result($res_niveau_4int);
?>