[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 09-19-2005, 09:02 AM   #1 (permalink)
NamePros Member
 
Join Date: Feb 2005
Posts: 58
118.00 NP$ (Donate)

RichardAFCB is an unknown quantity at this point


Recordset for simple search engine in PHP

Hi there,

I'm trying to create a simple search engine for a client so that customers can search his products. I have one field for text, and another with a drop down list of product types and an "All Items" option.

I've got my recordset to display search results matching the text field and the products, but I can't get it to display All Items if the customer selects that! So basically they can search by product type, but not across all the products.

I'm doing this in Dreamweaver. My actual PHP coding knowledge is...terrible!

Here is my code:

<?php
$colname2_products = "-1";
if (isset($_POST['type'])) {
$colname2_products = (get_magic_quotes_gpc()) ? $_POST['type'] : addslashes($_POST['type']);
}
$colname_products = "-1";
if (isset($_POST['searchterm'])) {
$colname_products = (get_magic_quotes_gpc()) ? $_POST['searchterm'] : addslashes($_POST['searchterm']);
}
mysql_select_db($database_kofightposters, $kofightposters);
$query_products = sprintf("SELECT * FROM products WHERE name LIKE '%%%s%%' AND type = '%s' ORDER BY name ASC ", $colname_products,$colname2_products);
$products = mysql_query($query_products, $kofightposters) or die(mysql_error());
$row_products = mysql_fetch_assoc($products);
$totalRows_products = mysql_num_rows($products);
?>

Any help would be greatly appreciated!

Cheers,

Rich
RichardAFCB is offline  
Old 09-19-2005, 02:38 PM   #2 (permalink)
NamePros Member
 
Join Date: Feb 2005
Posts: 58
118.00 NP$ (Donate)

RichardAFCB is an unknown quantity at this point


Anybody?
RichardAFCB is offline  
Old 09-19-2005, 04:08 PM   #3 (permalink)
Senior Member
 
Join Date: Sep 2005
Location: NC
Posts: 2,323
8.40 NP$ (Donate)

lilgee is a name known to alllilgee is a name known to alllilgee is a name known to alllilgee is a name known to alllilgee is a name known to alllilgee is a name known to all


All of the stuff is post to be in one field. You didnt post this in the right place
__________________
Sharing 50% profit for helping to sell on ebay. PM me for more info.
lilgee is offline  
Old 09-19-2005, 05:19 PM   #4 (permalink)
NamePros Member
 
Join Date: Feb 2005
Posts: 58
118.00 NP$ (Donate)

RichardAFCB is an unknown quantity at this point


That makes no sense to me....
RichardAFCB is offline  
Old 09-20-2005, 07:44 AM   #5 (permalink)
NamePros Member
 
Join Date: Feb 2005
Posts: 58
118.00 NP$ (Donate)

RichardAFCB is an unknown quantity at this point


Anybody?
RichardAFCB is offline  
Old 09-20-2005, 09:11 AM   #6 (permalink)
NamePros Member
 
yz0rx's Avatar
 
Join Date: Oct 2004
Posts: 96
160.00 NP$ (Donate)

yz0rx is an unknown quantity at this point


I'm a little confused. You have a search form with a drop down selection of categories and a search box for keywords? When people search by selecting a category, you want the results from that category only, unless they select the All Items category?
__________________
Firefox Users: My IP Tool
yz0rx is offline  
Old 09-20-2005, 10:48 AM   #7 (permalink)
NamePros Member
 
Join Date: Feb 2005
Posts: 58
118.00 NP$ (Donate)

RichardAFCB is an unknown quantity at this point


Fixed now!

Cheers,

Rich
RichardAFCB is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM
AdultSearch.us Monsterman Adult Domains For Sale 3 06-11-2004 07:54 AM
What should a US Adult Search be going for? Monsterman Adult Domain & Site Reviews 0 06-10-2004 12:29 PM
Search Engine Submission Webtwink For Sale / Advertising Board 7 08-27-2003 04:54 AM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:50 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85