delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

SELECT content
FROM module_master
WHERE site_id IN (721,1009)
</cfquery>
<cfloop query="findIDs">
<cfset found = REReplace(content, "/.*p_id=(\d+).*/", "\1", "all")>
<cfset ArrayAppend(test, found2)>
</cfloop>

Thanks for any help!


So, I'm trying to parse through a column and return all numbers found in it (their page id's). However, everything I've tried only returns one value and that's it. This is a sample of what the data looks like:
Code:
  1. If you need help with anything please contact <a href="http://www.something.com/?p_id=54">HR</a> or use this form <a href="http://www.something.com/?p_id=32">here</a>.
Copy Code
Right now I have this (Coldfusion is the langauge):
Code:
  1. <cfset test = ArrayNew(1)>
  2. <cfquery name="findIDs" datasource="">
  3. SELECT content
  4. FROM module_master
  5. WHERE site_id IN (721,1009)
  6. </cfquery>
  7. <cfloop query="findIDs">
  8. <cfset found = REReplace(content, "/.*p_id=(\d+).*/", "\1", "all")>
  9. <cfset ArrayAppend(test, found2)>
  10. </cfloop>
Copy Code
Thanks for any help!

TOP


Originally Posted by kiteless
What does the data look like? Are you saying you have a column that is holding a list of numbers like "8,27,97,275"? If so, why? That's going to cause a lot of problems. That should really be normalized into a separate table with one value per row.
No, I have a column full of data and want to parse through it to get all the page id's basically.

TOP


Originally Posted by kiteless
OK now I see. So each value of "content" is a string and you want to get the "p_id" values? What does this content string actually look like?
Code:
  1. If you need help with anything please contact <a href="http://www.something.com/?p_id=54">HR</a> or use this form <a href="http://www.something.com/?p_id=32">here</a>.
Copy Code




SELECT content
FROM module_master
WHERE site_id IN (721,1009)
</cfquery>
<cfloop query="findIDs">
<cfset found = REReplace(content, "/.*p_id=(\d+).*/", "\1", "all")>
<cfset ArrayAppend(test, found2)>
</cfloop>

Thanks for any help!

TOP

Back Forum