Click to See Complete Forum and Search --> : Help with MySQL REGEXP


web101
06-25-2007, 03:16 PM
I am using Using MYSQL 3.23 and PHP.

Two textfields in two tables with field and table names as...
base_txt in table1
stack_txt in table2

stack_txt relates to base_txt like this
"(<br>)base_text(<br>)" .
Both <br>'s being optional.

How do I write a SQL using REGEXP to extract the stack_text which has a particular base_text?

My attempted SQL is ....
SELECT table2.*
FROM table2, table1
WHERE table2.stack_text LIKE '<br>'+ base_text+'<br>'
AND table1.id = "1234"

mattyblah
06-28-2007, 12:27 AM
sorry, red flag here. should not do this kinda thing in the db. if you must, it'd probably be something like " where table2.stack_text in ('<br>' + base_text + '</br>', base_text)"

try that and let me know.