473,287 Members | 1,741 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,287 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 1551

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
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.