• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

textarea/sql script problem

New Here ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

I have a textarea tag named status ,where I copy a list of numbers . When the user submits the number using the submit button the code
Select numbers from table where numbers in (' #status# ')
<cfoutput> #status#)</cfoutput>

I know at least one of the numbers are in the database but my output returns nothing. Could the problem be that the textarea tag
only excepts text?:???


TOPICS
Advanced techniques

Views

404

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

If numbers is a numeric field, your query should crash because of your quotes. If numbers is a char field, you still want to get rid of the quotes and use the ListQualify function.

The problem could also be with your list. Does it look like this:
1
2
3

or does it look like this: 1,2,3
?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

my list looks like the second option 1,2,3

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

Try WHERE instr(<<field name goes here>>, '<<value to search for>>') <> 0

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 02, 2006 Jun 02, 2006

Copy link to clipboard

Copied

LATEST
In that case, the first part of my previous post answers your question. The only thing I would add is, if you field is char, get rid of all the spaces in your list before you apply the list qualify function.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation