[thelist] SQL gurus

Theodore Serbinski stanson at gmail.com
Fri Mar 25 14:12:34 CST 2005


Ok guys need some help with SQL. Simple example:

SELECT * FROM m    ----->

2005-03-24	95534	changed brakes
2005-03-24	235235	changed tires


Now I have:

SELECT date,mileage FROM m WHERE notes LIKE '%brakes'%'     ---->

2005-03-24	95534	changed brakes


Good so far. But now what I want to do is display the results of the
first query AND highlight any results that are found (not show only
the results but everything).

Is there a way in SQL to do this... like adding a field so the array
comes back as:

2005-03-24	95534	changed brakes    match
2005-03-24	235235	changed tires

Note the extra field "match" for only matches... this would make it
much easier in PHP to loop ... if field value == match then make bold,
or whatever.

Otherwise, seems to I have 2 arrays and need to check things which
seems inefficent.

Make sense? Whew it's friday and i'm brain dead so hope this works :)

ted


More information about the thelist mailing list