Hi, was wondering if anyone can give me advice on how I can carry this out.
two mysql tables
one with a list of names
------------------
bobby
angel
joey
brandy
jeff
mike
------------------
the other one with also a list of names (this table will include less
+names at all times)
------------------
jeff
mike
------------------
So if table 1 will always have about 5-15 more names and table 2 will always have way less, only about 3-4 rows or so....how can I join them and print them in the web browser into one list, having any name highlighted in BOLD if it appears in both tables.
So the above list will be printed as:
bobby
angel
joey
brandy
jeff
mike
I see one way but it might not be as efficient. The tables will grow in the future so I need to keep this in mind. One way was fetching both tables into arrays, and do a foreach statement on one array and tryin to match it to the values in the other. Am I on the right track with this? Not quite sure...well thanks.
Leo
2006-08-10 Retitled by planetscape, as per Monastery guidelines
( keep:9 edit:18 reap:5 )
Original title: 'Combining two fetches with DBI and MySQL'2006-08-20 Retitled by Arunbear, not off topic (Keep: 7, Edit: 20, Reap: 1)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.