Question
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?
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?
