Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Funky entries in list.

Status
Not open for further replies.

CTekMedia

Programmer
Oct 5, 2001
634
US
I have a search page with check boxes. It sends a set of values to a results page.

On the results page I have:
<!---

<!--- create list from form entry --->
<CFSET ListStatus = FORM.CBox>

<!--- create empty list --->
<CFSET ListRecords = "">

<!--- loop through first list --->
<CFLOOP LIST="#ListStatus#" INDEX="i">

<!--- pull records --->
<CFQUERY NAME="RecordsetList" datasource="QBL">
SELECT ID
FROM tb_main2
WHERE ARStatus = '#i#'
</CFQUERY>

<!--- add results to second list --->?
<CFLOOP QUERY="RecordsetList">
<CFSET ListRecords = ListAppend(ListRecords, RecordSetList.ID)>
</CFLOOP>

</CFLOOP>

--->

When I do a cfdump of ListRecords I get: ? ? ? 23,30,26,32,28,34

What is up with the question marks? They are bad data and are messing up my further processing these results.

TIA!

Cheers,

Bluetone
 
Is the "ListRecords" variable data coming from the dB or from the checkbox?

Check the dB to see if the ? are stored in there.

Click one checkbox at a time to see where the data becomes corrupt.

_____________________________
Just Imagine.
 
Have run CFDUMP along every step and all data looks good until after the last bit of code at the end - "add results to second list". That is when the question marks start showing up. It doesn't matter which check boxes are selected. Somehow the loop is introducing the question marks.

I don't have the list results going into a DB but I do have additional code on this page that pukes when it sees the question marks in the list.

Thanks!

Cheers,

Bluetone
 
I just modified the code to this and ended up with the same results. I now suspect bad data in the database but nothing is jumping out at me there.

<!--- create list from form entry --->
<CFSET ListStatus = FORM.CBox>

<!--- create empty list --->
<CFSET ListRecords = "">

<!--- loop through first list --->
<CFLOOP LIST="#ListStatus#" INDEX="i">

<!--- pull records --->
<CFQUERY NAME="RecordsetList" datasource="QBL">
SELECT ID
FROM tb_main2
WHERE ARStatus = '#i#'
</CFQUERY>

<!--- create list from query --->
<CFSET ListRecordsA = ValueList(RecordsetList.ID)>

<!--- add results to second list --->?

<CFSET ListRecords = ListAppend(ListRecords, ListRecordsA)>

</CFLOOP>

Cheers,

Bluetone
 
OK - I'm embarrassed to admit I have been chasing my tail. The question marks show up with the cfdump output but they are not part of the list. The code I have shown here works fine.

I had another issue with the follow on processing and just assumed it was the question marks. I started to write some code to remove the question marks from the list and finally figured out they were not actually in it.

Yeeesh. First time I have seen those though.

Cheers,

Bluetone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top