Jump to content

Small search script search all fields?


m00ch0

Recommended Posts

<?php

//connect to mysql

 

mysql_connect("localhost","x","x");

mysql_select_db("x");

$tbl_name="x"; // Table name 

 

$search=$_POST["search"];

 

$result = mysql_query("SELECT * FROM $tbl_name WHERE scan LIKE '%$search%'");

 

while($row=mysql_fetch_array($result))

 

{

 

  $scan=$row["scan"];

  $manufacturer=$row["manufacturer"];

  $description=$row["description"];

  $code=$row["code"];

  $partno=$r["partno"];

  $id=$r["id"];

 

echo "$scan <br> $manufacturer <br> $description <br> $code | $partno <br>";

 

}

?>

 

the code as you can see searchs only in the scan column how can I get it to search every column apart from id?

 

Link to comment
https://forums.phpfreaks.com/topic/65243-small-search-script-search-all-fields/
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.