0
votes

I am currently learning SQL. On my CFM page I have entered all the information from the instructions my professor has given us. I have even compared to other students to try and figure out what is wrong, but their pages look like mine. Please help me figure out what I have done wrong. Thanks.

This is the webpage link http://pretendcompany.com/jaedenemployees.html

Error:

72777A, on line 66, column 32, is not a valid identifer name. The CFML compiler was processing: The body of a CFOUTPUT tag beginning on line 62, column 3.

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="author" content="YOUR NAME HERE" />

<title>USU MIS 2100</title>

<style type="text/css" media="all">
td {
align:center;
width:955;
border:none;
text-align:center;  
vertical-align:top;
height:40px;
}


table.center{
    margin:auto;
}
h1{
font-size:26px;
color:#001F3E;  

}
h2{
font-size:20px; 
color:#ffffff;
}
img{ text-align:center;
}
td.photo{
margin:auto;    

}
</style>


</head>

<body>
<table class="center">
  <tr>
    <td  ><img src="images/header2_usu.jpg" width="755" height="265" alt="usu" /></td>
  </tr>
  <tr>
    <td style="height:900;background-color:#D7D9D9;padding-top:50px;">

    Employees by Department at Pretend Company, Inc.</font></p>
      <h1>Jaeden Harris</h1>

 <CFQUERY name="jaeden" datasource="employeedatasource">
 select Accounting,Administrative,Advertising,Payroll,Sales
 from employees
where DepartmentName in(#PreserveSingleQuotes(form.SelectDepts)#)
 </CFQUERY>

     <!--Place opening CFOUTPUT here -->
 <CFOUTPUT query="jaeden">


<table style="width:500;border:none;" class="center">
  <tr style="background-color:#72777A;">
    <td colspan="2"><h2> #DepartmentName# Employees </h2></td>
    </tr>
  <tr>
    <td style="width:250;text-align:left;">Employee:#FirstName# #MiddleName# #LastName#  
          <p>Title: #Title#
          <p>Email: #EmailName# @pretendcompany.com
          <p>Contact Number: #WorkPhone#

      </p>
      </td>
    <td style="width:140px;vertical-align:middle;" class="photo"><!--Reference Photograph field here -->      </td>
  </tr>
</table>
 </CFOUTPUT>


     </td>
  </tr>
      </table>


    </td>
  </tr>
</table>
</body>
</html>
1
You page is a HTML file, not CFM. I would start there. - Tristan Lee
thanks for your concern I downloaded it exactly how she gave us the base file, and have been editing with notepad++ it has a CFM extension. - user4542262
What's not processing? Is the query not being executed? Errors within the cfoutput tags? - Tristan Lee
You are within a CFOUTPUT, therefor anything with # signs gets evaluated, including the style background-color:#72777A;. Either escape those with a double hash: background-color:##72777A; or move the style out of your CFOUTPUT. - Tristan Lee
Contrary to what your teacher may have told you, I emphasize functionality over form. In other words, I get all my data and other programming code working first, and worry about display code afterwards. In the case of this question, I see a subject line and problem description about sql and cfml, and then a bunch of css. I stopped reading. Too much chaff hiding the wheat. - Dan Bracuk

1 Answers

6
votes

You are within a CFOUTPUT, therefor anything with # signs gets evaluated, including the style background-color:#72777A;. Either escape those with a double hash: background-color:##72777A; or move the style out of your CFOUTPUT.

Since you already have a section for your CSS, it may be wise for you to move all your table styles from inline with the HTML to the top and just apply classes to your elements.