How NOT to Code - Challenge 12
Feb 10, 2010
Today's challenge is in ColdFusion and there are several things wrong here. See how many you can find..
<cfquery datasource="#sysDB#" name="find">
select * from users
where id='#session.id#'
</cfquery>
<cfloop query="find">
<cfquery datasource="#sysDB#" name="findmeetings">
select * from meetings
where deptid='#deptid#' and status = 'open'
</cfquery>
...
</cfloop>
Rudi Shumpert wrote on 02/10/103:41 PM
Lets see....1) Should not use select *. List out the columns needed.
2) If the first query was written correctly, you would not need the 2nd one.
There are probably others I missed.