Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

projectandFacultyQueries.cfm 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!-- Include Bootstrap CSS -->
  5. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  6. <title>Projects for Student</title>
  7. </head>
  8. <body>
  9. <cftry>
  10. <!-- Define the project query for faculty involved in "Website Redesign" project -->
  11. <cfquery name="students" datasource="task">
  12. SELECT * FROM student
  13. </cfquery>
  14. <cfdump var="#students#" expand="true" label="Students Array">
  15. <!-- Check if the project query exists and has records -->
  16. <cfif isQuery(students)>
  17. <!-- Loop through the project query and display faculty names -->
  18. <ul>
  19. <cfoutput query="students">
  20. <li>#htmlEditFormat(students.fname)#</li>
  21. </cfoutput>
  22. </ul>
  23. </cfif>
  24. <cfcatch>
  25. <!-- Handle any errors that occur within the try block -->
  26. <p>Error retrieving student data: #cfcatch.message#</p>
  27. </cfcatch>
  28. </cftry>
  29. <!--- Loop through the students query and display student information --->
  30. <!--- Loop through the students query and display student information --->
  31. <table border="1">
  32. <tr>
  33. <th>Student ID</th>
  34. <th>Name</th>
  35. <th>Major</th>
  36. <th>Level</th>
  37. <th>Birth Year</th>
  38. </tr>
  39. <cfoutput query="students">
  40. <tr>
  41. <td>#students.sid#</td>
  42. <td>#students.sname#</td>
  43. <td>#students.major#</td>
  44. <td>#students.level#</td>
  45. <td>#students.byear#</td>
  46. </tr>
  47. </cfoutput>
  48. </table>
  49. </body>
  50. </html>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...