473,809 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_mer chandising'];
$design = $HTTP_GET_VARS['design'];
$executive = $HTTP_GET_VARS['executive'];
$hr = $HTTP_GET_VARS['human_resource s'];
$manufacturing = $HTTP_GET_VARS['manufacturing'];
$ro = $HTTP_GET_VARS['retail_operati ons'];
$sm = $HTTP_GET_VARS['sales_and_mark eting'];
$technical = $HTTP_GET_VARS['technical'];
$vm = $HTTP_GET_VARS['visual_merchan dising'];

$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 1579

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

Similar topics

4
15974
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 is as follows. I have a guestbook type code I'm trying to write, but when the results get printed to a webpage, it outputs completely nothing as what was entered in the guestbook database. No errors appear to be generated, and I can't see if...
2
10555
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 update the record in MySQL. The problem is, as soon as the "Update" button (type="submit") is pressed, all of the data disappear from the form. How can that be prevented? Here is my code:
5
2314
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 the commands directly from the MySQL> mode, my access works fine (see example 1 below). But when I try to access the table from PHP, I have a syntaxt problem (see example 2 below). Can anyone please type up the correct PHP syntaxt for me? The...
67
12560
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 considering MYSQL for development an open_source web database. Why isn't PostgreSQL being considered or talked about by major industry giants? As a DBA I know that Postgres is far superior to MYSQL but if the industry directs it's energies towards...
1
4859
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 wondering if anybody has experienced the same issues
2
1198
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
3776
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 understand it I need a PHP script that pulls the query and dumps the data into XML format, that is called by triggering a javascript event that reads that file with XMLhttprequest.
4
1724
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 this? Thanx in advance! JBK
2
15898
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 select box. I have used some thing like this. print "<select MULTIPLE SIZE='6' name='db_test'>"; while($row = mysql_fetch_object($handle)) {
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.