hi can anyone tell me whats rong with this script becose he dont show anything just like this: , , , , , can anyone help me here <?php //Query to grab that stuff (Change 100 to how many searches to show) $query = mysql_query("SELECT * FROM search ORDER BY id DESC LIMIT 0,100"); //Display it while($row = mysql_fetch_array($query)) { $dumpintheforest = array(":","#","/","'",'"',"(",")","?",",","~","@","<",">"); $explodingcat = array("<",">","/","'",'"',";"); $newurl = str_replace($dumpintheforest,"-",$row[query]); $new = str_replace($explodingcat,"",$row[query]); echo "<a href='ddl/search.php?search=".$newurl."'>".$new."</a>, "; } ?> PHP:
Echo $row[query] and see if it contains the expected content. Also, for better performance, defined these arrays outside the loop: $dumpintheforest = array(":","#","/","'",'"',"(",")","?",",","~","@","<",">"); $explodingcat = array("<",">","/","'",'"',";"); PHP:
Are you sure it should return any results? Before the while() loop, add: echo mysql_num_rows($query); PHP:
i guess the problem is in the final echo.. try this echo '<a href="ddl/search.php?search='.$newurl.'">'.$new.'</a> ';
If the commas show, then does it mean that it loops through the table. Look at the source code, you'll probably see the <a> tags. My guess is that $row[query] does not contain the expected content. But I'll never know since you seemed to ignore my suggestion.
no nico_swd i will never ignore you i just dont understaind how to modifed that's it like you now i am not good in php
my be the error is here in this code becose i have to put this code in the top of search.php and other in recent.php
Echo $row['query'] in the loop. What does it output? Also, on another side note, this: if(isset($_GET['q'])) { $search = $_GET['q']; } elseif(isset($_POST['q'])) { $search=$_POST["q"]; } PHP: Can be simplified by: $search = $_REQUEST['q']; PHP:
i did add the Echo $row['query'] in the loop now he show me like this Download accelerater PlusDownload accelerater Plus, Download accelerator plusDownload accelerator plus, systematic chaossystematic chaos, PDFPDF and the fierst word without link and the secand with link ex: Download accelerater PlusDownload accelerater Plus,
hi nico_swd i add the Echo $row['query'] like you said thene he show me dublicate search eachword he show him twice so i delete this code and find out another error in the link i modifed now he show everthing perfect exepect one thing in the home page supose to here whene i include this in the home page <?php include "recent.php"; ?> PHP: he show the recent search but there is nothing he dont show nothing what i have to do to make it work and thanks for help me