473,424 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,424 software developers and data experts.

Simple MySQL Search from MySQL beginner

Hi,

I'm trying to build a simple search for a database of jobs. Users can
search using three groups of critera:

1) Area (check boxes)

[ ] Buying and merchandising
[ ] Design
[ ] Executive
[ ] Human resources
[ ] Manufacturing
[ ] Retail operations
[ ] Sales and marketing
[ ] Technical
[ ] Visual merchandising

2) Location (dropdown)

All, UK specific, Africa, Asia, Europe, Middle East, Americas, Oceania
3) Keyword (single text box)

I'm currently using the following:

---

$location= $HTTP_GET_VARS['searchlocation'];
$keyword= '%'. $HTTP_GET_VARS['searchkeyword'] . '%';
$bm = $HTTP_GET_VARS['buying_and_merchandising'];
$design = $HTTP_GET_VARS['design'];
$executive = $HTTP_GET_VARS['executive'];
$hr = $HTTP_GET_VARS['human_resources'];
$manufacturing = $HTTP_GET_VARS['manufacturing'];
$ro = $HTTP_GET_VARS['retail_operations'];
$sm = $HTTP_GET_VARS['sales_and_marketing'];
$technical = $HTTP_GET_VARS['technical'];
$vm = $HTTP_GET_VARS['visual_merchandising'];

$query = "SELECT * FROM jobs WHERE location LIKE '$location' AND
description LIKE '$keyword' AND (`buying and merchandising` LIKE '$bm'
OR design LIKE '$design' OR executive LIKE '$executive' OR `human
resources` LIKE '$hr' OR manufacturing LIKE '$manufacturing' OR `retail
operations` LIKE '$ro' OR `sales and marketing` LIKE '$sm' OR technical
LIKE '$technical' OR `visual merchandising` LIKE '$vm' ) ";

$result = @mysql_query ($query);

----

If you pick a location or enter a keyword it works OK, but checking a
check box (the job areas) to narrow the results down doesn't work...

Any ideas on a straightforward MySQL query to solve this would be much
appreciated (I'm quite new to this!).

Thanks,

OP.

Jun 27 '06 #1
0 1555

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dariusz | last post by:
I am a beginner in PHP and MySQL, and am working through a book and various online tutorials on PHP and MySQL and now stuck - installed everything on "localhost" and it all works fine. My question...
2
by: Mark | last post by:
A beginner in this area, I have been able to read a record from a MySQL database and populate an HTML form (wow!). Now, my goal is to allow the user to edit the contents of the form and then...
5
by: Alex Glaros | last post by:
I need help on my basic table connection syntaxt using PHP. I call the php from a web browser url_name_goes_here/test.php. The database name is tennis and the user name is tennis. If I type...
67
by: Bob Powell | last post by:
To whom it may concern: I find the recent articles in various trade publications a little disturbing due to the lack of PostgrSQL mention. I continue to see articles about how IBM may be...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
2
by: Master | last post by:
hey first: i'm a beginner so please forgive when i ask a stupid question. second: i've seen a MySql database have many kinds of fields, can anybody tell me what they mean? Keith
7
by: Ivan Marsh | last post by:
Hey Folks, I'm having a heck of a time wrapping mind around AJAX. Anyone know of a simple, straight-forward example for pulling a simple query from mysql with PHP using AJAX? As I...
4
by: | last post by:
Hello... i have a table which contains a column named "ask" and a column named "per"... my think is that i want to search in "ask" and echo the data stored in "per" for this entry... How do i do...
2
by: sathyashrayan | last post by:
Dear group, I have a task where I have to fetch datas from mysql and display it in the multiple select list box. I have fetched the datas and it is getting diplayed correctly in the multiple...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.