Jump to content

Searching


timmah1

Recommended Posts

I'm trying to do this search

 

<input type="text" name="find" /> in
<select name="field">
<option value="j_number">Job Number</option>
<option value="j_salesperson">Salesperson</option>
<option value="j_location">Location</option>
<option value="j_company">Company</option>
</select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" /

 

here is the search function


$find = strtoupper($_POST['find']);
$find = strip_tags($_POST['find']);
$find = trim ($_POST['find']);

$data = mysql_query("SELECT * FROM orders WHERE upper($field) LIKE '%$find%'");

while($result = mysql_fetch_array( $data ))
{

 

But no matter what I search for , it always gives me this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/cheezy/public_html/plumbing/pages/page.search.inc.php on line 27

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/cheezy/public_html/plumbing/pages/page.search.inc.php on line 49
Sorry, but we can not find an entry to match your query

 

Any idea why?

 

Thanks for your help in advance

Link to comment
https://forums.phpfreaks.com/topic/97690-searching/
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.