473,785 Members | 2,919 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Search within a search within a search

I'm having some trouble with the search field that i am setting up
using PHP and HTML, I am connecting to a database to return proper
information pertaining to something being searched. I originally set
up a search to work like this :

$SQL = "
select id,
name
from repository
where upper(name) like upper('%$search %')
";
$Result=SubmitQ uery($db,$SQL);
while (OCIFetch($Resu lt)) {
$repo_id = OCIResult($Resu lt,"ID");
$name = OCIResult($Resu lt,"NAME");
echo"

and display the results accordingly, This was one teer of the
searching, the database would then search modules and files just as
seen above, but I ran into the problem where the correct values are not
being passed, so it was searching all repositories, then all modules,
then all files.... is it possible to search like this:

Repository #1
---Module #1 in Repo#1
------files in Module #1
---Module #2 in Repo #1
------files in Module #2 Repo #1
etc.\
\\
\\
\\
Repository #2
--Module #1 in Repo #2
etc......

is this possible to do a search under a search under a search with SQL
PHP?????

Jan 25 '06 #1
1 1531
Rachelle wrote:
<snip>
is it possible to search like this:

Repository #1
---Module #1 in Repo#1
------files in Module #1
---Module #2 in Repo #1
------files in Module #2 Repo #1
etc.\
\\
\\
\\
Repository #2
--Module #1 in Repo #2
etc......

is this possible to do a search under a search under a search with SQL
PHP?????


SELECT not tested:

select <fields>
from repository r
join module m on r.rep_id = m.rep_id
join file f on m.mod_id = f.mod_id
where <conditions>
order by <whatever>
limit <something>

With this you'll get something like

rep_id | rep_name | mod_id | mod_name | file_id | file_name | ...
-------+----------+--------+----------+---------+-----------+----
1 | master | 1 | test | 1 | test.php | ...
1 | master | 1 | test | 2 | echo.php | ...
1 | master | 2 | environ | 3 | data.php | ...
2 | slave | 3 | listen | 4 | open.php | ...
....

Then use PHP to format the data however you like best :-)
Maybe putting it all in an array first will make it easier to format as
you need.

--
If you're posting through Google read <http://cfaj.freeshell. org/google>
Jan 25 '06 #2

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

Similar topics

3
1763
by: Andy Jacobs | last post by:
Hi all I have a search function on a site of mine. At the moment, the content is delivered using this: <?php echo $row_Recordset1; ?> The search function goes through the table and displays the titles of the pages that contain the term.
39
4410
by: Noticedtrends | last post by:
Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if authors of content subconsciously mention the keywords "lately and noticed" within the same brief sentence, the reader may infer "an unintended message" through the process of "inferential scanning;" a method of noting "semantic anomalies" which may...
32
14898
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
7
1719
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' now, when i do the search, and only type in red, to search for red, it only brings back record 2, and not record 1 as well.
5
2405
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as three bolded periods '...' in search-result listings. Additionally, most content is outdated; as many users need up-to-date content. Hence, filtering-through search-results becomes quite cumbersome. The newsgroup listings allow detailed...
0
2081
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
1
1247
by: Lance Hoffmeyer | last post by:
Hey all, How do I add another index inside a re.search? I want to add for j in BASE = re.search ... sh.Cells97... for i ....
1
2530
by: cglewis03 | last post by:
Hello, I am trying to build a search form with several different options to choose from. Currently it is set up to open within the same window if a single option is selected and open within a frameset if the "ALL" option is selected. Is there anyway to get the results to open in new windows? So if the user were to select the "ALL" option, is it possible to open 3 new windows with each result displaying? Here is my code:
1
1117
by: calhoun | last post by:
Hi All, sorry for the newbie question but how do I search within a Sub-Forum? I was in POSTGRESQL and there was an option to search within the forum. I tried to search 'system tables postgresql' but the results of the search returned alot of links in other sub-forums for other databases. I then tried the search in the topmost menu and the results were the same. Is it possible to search only within a specific sub-forum/database/topic? Thanks.
0
9480
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
10319
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...
1
10087
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
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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
7496
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
6737
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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

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.