|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I will have a list of values in a column on my table. I need to write a SQL query that detects if the value is in the column. An example of the data would be:
8,9,20,44,39,82 and say the value was 44. Is there a regex express I could use in PHP/SQL to determine if the value is actually present? |
| Sponsored Links |
|
|
|
|||||
|
If you are asking how to determine if the value '44' is in a field that contains all of those values you could easily use regexp.
Code:
SELECT * from table WHERE field REGEXP '44,' ;
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||||
|
Quote:
Well thank you! ![]()
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
|
|||
|
You could have also used MYSQL 'LIKE' function
Code:
SELECT * from table WHERE field LIKE '%,47,%' ;
__________________
IQStaffing - IT Recruiter - Need an IT job? let us find you one! http://www.iqstaffing.com |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sending mail to a group of people (Mailing list support/Emulation) | nesrait | easyContact | 1 | 07-25-2007 09:48 PM |
| Binary to list?? | TAboy24 | C and C++ | 3 | 05-03-2007 09:40 AM |
| Adding a calculated column to a table | reachpradeep | Database & Database Programming | 0 | 03-05-2007 08:13 AM |
| GMail Vulnerable To Contact List Hijacking | TcM | Computer Software/OS | 28 | 02-17-2007 11:36 AM |
| Sudoku can be solved using SQL..Take a look! | roger | Database & Database Programming | 5 | 07-04-2006 03:20 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%