Adobe Dreamweaver Forums



Last 10 THreads :         Re: Flash Player 9 for Pocket PC (Last Post : HowardZinn - Replies : 0 - Views : 1 )           »          UserAgent (Last Post : DJPerl - Replies : 0 - Views : 1 )           »          Pause videos on page load (Last Post : DLMAES - Replies : 1 - Views : 2 )           »          Lesson 17 Problem (Last Post : Jim Daniel - Replies : 4 - Views : 5 )           »          Flash for windows Mobile (Last Post : kelcel7545 - Replies : 0 - Views : 1 )           »          Share your opinion on Adobe Contribute for a chance towin $500USD! (Last Post : Ramesh Gopalakrishna - Replies : 0 - Views : 1 )           »          MySQL Error# : 2002 in Dreamweaver CS3 (Last Post : jmsearcy - Replies : 24 - Views : 25 )           »          Opensuse 11.0 install error (Last Post : RahulRohilla - Replies : 4 - Views : 5 )           »          Flash Publishing Help (Last Post : DLMAES - Replies : 1 - Views : 2 )           »          CFFEED Error message (Last Post : Azadi - Replies : 7 - Views : 8 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags: , , , , , ,

Reply
  #1 (permalink)  
Old 07-23-2008, 04:44 PM
Steve Grosz
 
Posts: n/a
Diggs:
Default Getting everything but empty fields in MySql query

I was trying to get all users email addresses that actually have a email
address entered in the database. I tried:

<cfquery name="AllUsersCSV" datasource="SalleBoise">
select #form.sql#
from inforeq
where #Search1#=<cfqueryparam cfsqltype="cf_sql_smallint" value="1"> <cfif
form.sql eq "Cust_Email">and Cust_Email not ''</cfif>
</cfquery>

But kept getting a "You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near '''' at line 3" error

What would be the 'proper' way to search for these records?


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2008, 05:35 PM
Dan Bracuk
 
Posts: n/a
Diggs:
Default Re: Getting everything but empty fields in MySql query

Your specific error comes from the word "not". It should be either <> ", is
not null", or both, depending on how you store your data.

There may be some other issues, depending on what the values of form.sql and
Search1 are.



Reply With Quote
  #3 (permalink)  
Old 07-23-2008, 05:36 PM
satheesh_p
 
Posts: n/a
Diggs:
Default Re: Getting everything but empty fields in MySql query

You can print your SQL statement and copy the statement and execute it in SQL. This way you can easily figure out the problem.

Hope the above helps.
Thanks,
Satheesh.
Reply With Quote
  #4 (permalink)  
Old 07-23-2008, 06:32 PM
Steve Grosz
 
Posts: n/a
Diggs:
Default Re: Getting everything but empty fields in MySql query

Thanks Dan, the <> worked just great......

"Dan Bracuk" <webforumsuser@macromedia.com> wrote in message
news:g67ofl$j26$1@forums.macromedia.com...
> Your specific error comes from the word "not". It should be either <> ",
> is
> not null", or both, depending on how you store your data.
>
> There may be some other issues, depending on what the values of form.sql
> and
> Search1 are.
>
>
>



Reply With Quote
  #5 (permalink)  
Old 07-23-2008, 07:02 PM
-==cfSearching==-
 
Posts: n/a
Diggs:
Default Re: Getting everything but empty fields in MySql query

Steve Grosz wrote:
> Thanks Dan, the <> worked just great......


The on-line MySQL documentation can also be very helpful for syntax problems
or questions

http://dev.mysql.com/doc/refman/5.0/...perator_not-eq
ual

Reply With Quote
Reply


Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 04:31 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk