473,508 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple records and tables query - help

Not sure if I should post in php or sql,

$query = "SELECT page.*, url_pages.* FROM `page` LEFT JOIN `keywords`
USING(`page_id`) LEFT JOIN URL_PAGES USING (`page_id`) WHERE
MATCH(`keywords`.`keyword_txt`) AGAINST ('$keyword'IN BOOLEAN MODE)";

I got a keyword table, the fulltext finds the word in the keywords table
and relates the page_id field to identical fields in the page table and
the url table.

keyword table
page_id keyword
1 foo

page table
page_id title description
1 my urls It' my webpage

url table
page_id url
1 goglle1.com
1 goglle2.com

I want *one reord* rendering like this:

my urls It' my webpage goglle1.com goglle2.com

ie. the user sees one record

BUT in my mysql/php attempts i get this rendering:
my urls It' my webpage goglle1.com
my urls It' my webpage goglle2.com

What's the strategy to combine into *one* record? I can split things up
into two separate querys? I need help. Thanks
Jul 17 '05 #1
1 2239
leegold2 <le*****@nospam.net> wrote:
Not sure if I should post in php or sql,

$query = "SELECT page.*, url_pages.* FROM `page` LEFT JOIN `keywords`
USING(`page_id`) LEFT JOIN URL_PAGES USING (`page_id`) WHERE
MATCH(`keywords`.`keyword_txt`) AGAINST ('$keyword'IN BOOLEAN MODE)";
...
I want *one reord* rendering like this:

my urls It' my webpage goglle1.com goglle2.com

ie. the user sees one record

BUT in my mysql/php attempts i get this rendering:
my urls It' my webpage goglle1.com
my urls It' my webpage goglle2.com

What's the strategy to combine into *one* record? I can split things up
into two separate querys? I need help. Thanks


You can't do this with SQL. You will have to process the results in code.
Scan through the query results, accumulating the URL field, while watching
for the primary key field to change.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 17 '05 #2

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

Similar topics

7
6169
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
1
6561
by: Charlie | last post by:
Hello, I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML...
11
4501
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
19
3442
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
6
4961
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
52
6270
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
5
4083
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
7
15613
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
11
3649
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
6
9377
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
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
7336
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
7504
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...
1
5059
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...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
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 ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
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...

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.