473,396 Members | 2,024 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,396 software developers and data experts.

Creating Search Code ?

190 100+
Hi ,

i am developing an application based on real estate agents.I need to put n no. of search criteria in that.
I want to know the best coding for creating search criteria with minimum efforts. I have some 10 to 15 fields on which i need to create search. do i have to write all queries or there is any other professional method which can help me in writing a single or less queries with different search criteria.
Aug 5 '10 #1
3 1038
perhapscwk
123 100+
suggestion as below.

each criteria need one more row as below

Expand|Select|Wrap|Line Numbers
  1.  
  2. $sql = "select * from table where id=xxx";
  3.  
  4. if ($criteria1){
  5.     $sql  .= " and criteria1 like \"%$criteria1%\"";
  6.     }
  7. .
  8. .
  9. .
  10.  
  11. if ($criteria15){
  12.     $sql  .= " and criteria15 like \"%$criteria15%\"";
  13.     }
  14.  
Aug 5 '10 #2
Shalini Bhalla
190 100+
till now i am doing this only , but i need to take care of n no. of criteria , anything in shortcut .
Aug 5 '10 #3
perhapscwk
123 100+
use loop...

table field store as array
variable store as array.
Aug 6 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jimmy Tran | last post by:
Hello everyone, I have one major table that contains some data and contain keys to many other tables. I am using RIGHT JOIN query method to get all my data and everything works very well. Now I...
2
by: Paul Lee | last post by:
Hi all, I'm trying to use a Java written search code to traverse a DOM hierarchy. I'm mainy using code that I obtained from the Sun website. Basically, in main(), I have Element rootElement =...
10
by: Fred | last post by:
OK, I can now successfully enter data into my MySQL database through my CGI web page. I can click a button and retrieve all the records, but I can not seem to get the search code to work. ...
2
by: dismantle | last post by:
Hi all, I need code help to perform a search code using access database i tried to search other threads but only saw this thread http://www.thescripts.com/forum/thread580180.html and its very...
4
by: dismantle | last post by:
Hi all, I need code help to perform a search code using access database i tried to search other threads but only saw this thread http://www.thescripts.com/forum/thread580180.html and its very...
2
by: karechio | last post by:
Hi Guys i am in dire need of a Search code in asp.net (VB) that searches a several tables in a database. I would appreciate any Help Offered. Thanks in Advance.
2
by: Clement | last post by:
I am now creating IR engine in python which has its own database implementation . For nearly 2GB files it works fast. Can i expect the same speed when my database goes large. Else i have to chose...
1
by: captainmorgan | last post by:
I have included an unbound field called which is used to quickly move to the desired record, by searching the last name field. I have been using this code for a few years, with only one...
5
by: elbatz | last post by:
Hello there..need help how to create search function in text box to search records from access database using vb6..thanks a lot
4
by: --~AngelisIIDX~-- | last post by:
Hey ya guys. Just a pre thank you for any help or info. Basically here is what is going on. I have a search engine I've been working on and as of right now it is working with multiple key words....
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
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
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...

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.