Hello everyone
you can create a pager, in this code
Answer search found nothing
Please can you help me with this

<form  action="Search.php" method="post"> <input type="text"  name="Words" /> <button type="submit">Search</button></p> </form> <? 

$consulta = $_POST['Words'];
if ($consulta == "") {
} else { 
mysql_connect($dbhost,$dbuser,$dbpass) or die(mysql_error());
mysql_select_db($dbdatabase) or die(mysql_error());
$SQL = mysql_query("SELECT * FROM  People 
INNER JOIN Position ON People.idCarg=Position.idCarg 
INNER JOIN Vacation ON People.idVac=Vacation.idVac  

WHERE 
names LIKE '%$consulta%' OR 
namePosition  LIKE '%$consulta%' OR 
nameVac LIKE '%$consulta%' 0,5");

echo " <center>Results: $consulta<br> </center>";

while($row = mysql_fetch_array($SQL)) {

$items = $row["names"];
$items = $row["namePosition"];
$items = $row["nameVac"];
?> <?="".$row["names"].""?> <?="".$row["namePosition"].""?> <?="".$row["nameVac"].""?> <br> <? } ?> <?  if ($items == "") { echo "<center>No results</center>";  } else {    mysql_close; }  }   ?> 

Recommended Answers

All 3 Replies

Member Avatar for diafol

Please can you help me with this

Before you start writing production code though, consider updating HTML and PHP to 2010+. Not clear what you want: Answer search found nothing - so is it help with extracting info from the DB?

I think it is very old code

what I need is a search engine
having pagination
find search results
and can go page by page

minimum limit of 5 results per page

Member Avatar for diafol

If you don't understand PHP, then not sure if what we suggest is going to make much sense. There are many better scripts out there. Perhaps search for a NEW one. The code you intend using here will probably open you up to SQL Injection. A fate as bad as it sounds.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.