PHP Query

I'm trying to write a query that uses RegEx but I'm not sure I know what I should be doing here.  One of the fields I am querying has numbers and words in it.  I want to only query the numbers.
		$laser_query = ee()->db->query(
		SELECT t1.entry_id AS id, t1.field_id_1091 AS title, t1.field_id_1141 AS image, t2.url_title AS url_title
		FROM exp_channel_data t1, exp_channel_titles t2 
		WHERE (t1.field_id_3731 = $cw || t1.field_id_3731 = $pulsed || t1.field_id_3731 = $pulsednp || t1.field_id_3731 = $quasi || t1.field_id_3731 = $ultrafastfp || t1.field_id_3731 = $ultrafastf)
		AND t1.field_id_3781 <= $wave_max REGEXP '/[^0-9]/'
		AND t1.field_id_3781 >= $wave_max REGEXP '/[^0-9]/');

		
		$lb = $laser_query->result_array();
		
		foreach($lb as $row){

Open in new window

LVL 8
rgranlundAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
What does "has numbers and words in it" mean.

It's like this:
123 word word
word 123 word

Or like this

1 word 234 word 45 ?

If the second option, you want the first number, a number from all the figures, the sum of the numbers, etc?
Dan CraciunIT ConsultantCommented:
BTW, REGEXP returns 1, 0 or NULL: http://www.w3resource.com/mysql/string-functions/mysql-regexp-function.php
You're sure you want to compare t1.field_id_3781 against those values?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.