GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

View Poll Results: Do regex's suck?
Yes! 1 33.33%
No! 2 66.67%
Sometimes... 0 0%
Voters: 3. You may not vote on this poll

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Jun-2003, 09:49
Elmseeker's Avatar
Elmseeker Elmseeker is offline
Junior Member
 
Join Date: Jan 2003
Posts: 87
Elmseeker is on a distinguished road

I hate Regex...


If anyone here is any good with regular expressions I could use some help...I am writing a piece of software that needs to keep track of users in the database by their ID number so I have a DB fieled that contains all of the ID numbers of the members for each group something like 1, 2, 5, 99, 1000, etc...what I need to be able to do is whenever someone tries to "post" to a certain group it should check this table and make sure they are member first...I also need to be able to add new people to the end of the list automatically...ack...I hate MySQL...I am decent enough with it most of the time but it can be a real pain in my patooty! Thanks Guys!

Elmseeker
  #2  
Old 25-Jun-2003, 10:04
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I don't see how you need a regular expression for this... Why wouldn't array_filter() / in_array() work? Of course, you would need to get these values into an array first.

Perhaps I am missing something... would help if you describe the problem with a little more details.

I voted NO by the way, working with regexs is like riding a bike - lots and I mean LOTS... of scratches and bruises in the beginning and then one day, you just don't think about it anymore!

... I wish!
  #3  
Old 25-Jun-2003, 10:11
Elmseeker's Avatar
Elmseeker Elmseeker is offline
Junior Member
 
Join Date: Jan 2003
Posts: 87
Elmseeker is on a distinguished road
Well, the main problem is that I need to seperate all of the different numbers from each other...they are comma seperated so i need to strip out the commas and then...yes putting the numbers into an array from there would be the way to go...
  #4  
Old 25-Jun-2003, 11:11
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
simple....

PHP Code:

$number = explode(',', $test); 


__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Google hate itself? jrobbio Open Discussion Forum 0 01-Jul-2003 05:00
A 'not' regex Allowee MySQL / PHP Forum 1 07-Jun-2003 21:20

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:44.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.