Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>i made it work its pretty basic and i guess it has deprecated thingys but il upload for ppl that search for things... just make a simple form and then make a php file </p> <pre><code> &lt;?php error_reporting(E_ALL); //This is only displayed if they have submitted the form echo "&lt;h2&gt;Results&lt;/h2&gt;&lt;p&gt;"; $find =$_POST["find"]; //If they did not enter a search term we give them an error if ($find == "") { echo "&lt;p&gt;You forgot to enter a search term"; exit; } // Otherwise we connect to our Database mysql_connect("localhost","Anton","zouzou13") or die(mysql_error()); mysql_select_db("Ptyxiakh") or die(mysql_error()); // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM documents WHERE keywords LIKE'%$find%'"); //And we display the results while($result = mysql_fetch_array( $data )) { echo '&lt;p&gt; &lt;strong&gt;',$result['document_name'], '&lt;/strong&gt; &lt;br&gt; ', $result['first_paragraph'],'... &lt;br&gt; &lt;/p&gt;'; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query&lt;br&gt;&lt;br&gt;"; } //And we remind them what they searched for echo "&lt;b&gt;Searched For:&lt;/b&gt; " .$find; ?&gt; </code></pre> <p>This worked for me :) thx!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload