Jump to content

list results with links..


techker

Recommended Posts

hey guys i have this ajax autos suggest  form and it works but all the suggestions have the same link..

 

 

 

 
// Query
$q = @$_GET['q'];
$ql = strlen($q);
 
// Target mode
$target = @$_GET['target'];
 
// Limitation of suggestions
$limit = "15";
 
$results = array();
$sql = "SELECT *
FROM $Fiscale
WHERE LEFT(Nom, $ql)='$q'
ORDER BY `Nom`
LIMIT $limit";
$res = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_assoc ($res)) {
$results[] =  $row["Nom"]."-".$row["Prenom"];
$E_ID =  $row["N_Fiche"];
}
 
if(!empty($results)) {
echo "<ul>";
for($i=0;$i<count($results);$i++){
$url = @str_ireplace("%s", urlencode($results[$i]), $_GET['E_ID']);
 
echo "<li><a href='V.php?N_F=".$E_ID."' target='".$target."'>".str_ireplace($q, $q."<b>", $results[$i])."</b></br></a></li>";
}
echo "</ul>";
} }
Link to comment
https://forums.phpfreaks.com/topic/275821-list-results-with-links/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.