BigLebowski

Well-Known Member
Dec 24, 2007
75
0
56
hi there

Quick question. I have a table full of char(255) rows with plain text in them. I wish to search through for any instance of four or 16 digits, eg
1234 or 1234567812345678 or 1234-5678-1234-5678
(I'm trying to locate credit card numbers).

I'm a bit rusy on SQL. anyone suggest a select statement pls?

The field is called "thread_content_part"

Cheers
Dude
 

elleryjh

Well-Known Member
Apr 12, 2003
479
0
166
Code:
SELECT `thread_content_part` FROM `table_name` WHERE `thread_content_part` LIKE = '%1234%'
or to select the whole row:

Code:
SELECT * FROM `table_name` WHERE `thread_content_part` LIKE = '%1234%'

Of course replace table_name with the actual table name.