October 13, 2008

1st semester has been concluded

Finally, sleepless nights are all through! Cold fusion, IT Research and examinations has come to an end, me and my group mates work pretty hard on those school requirement, hard work and perseverance was our weapon, casualties are blood and sweat, but all those suffering were washed away when we presented our platform that took a high rating response from our professors. It was a job well done, thanks to my friends and groupsmates that help me through the way. Had a blast in this semester, hope that the next would be much cooler and my IT knowledge would be enhanced more.

Well, thats all for now! Catch you guys next time!

August 7, 2008

CFM Inserting Values to the Database Table

Cold Fusion Code:

Inserting Values to the Database Table.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<cfif IsDefined(’FORM.submit’)>
<cfquery  datasource="dsSchDb">
INSERT INTO Employee(employee_ID, lastname, firstname, age, address, city, department_ID, salary)
VALUES(#FORM.employee_ID#, ‘#FORM.lastname#’, ‘#FORM.firstname#’, #FORM.age#, ‘#FORM.address#’, ‘#FORM.city#’, #FORM.department_ID#, #FORM.salary#)
</cfquery>
<cfoutput>#FORM.lastname#, #FORM.firstname# Has Been Successfully Added….</cfoutput>
</cfif>

<form name = "name" method="post" action="">
<table width="100%" border="1">
  <tr>
    <td>Employee ID</td>
    <td><input name="employee_ID" type="text"></td>
  </tr>
  <tr>
    <td>Last Name</td>
    <td><input name="lastname" type="text"></td>
  </tr>
  <tr>
    <td>First Name</td>
    <td><input name="firstname" type="text"></td>
  </tr>
  <tr>
    <td>Age</td>
    <td><input name="age" type="text"></td>
  </tr>
  <tr>
    <td>Address</td>
    <td><input name="address" type="text"></td>
  </tr>
  <tr>
    <td>City</td>
    <td><input name="city" type="text"></td>
  </tr>
  <tr>
  <td>

Department
</td>
  <td>
 
  <select name = "department_id">
  <cfquery name = "qDept" datasource="dsSchDb">
  SELECT department_id, name
  From Department
  ORDER BY name
  </cfquery>
  <cfoutput query = "qDept">
  <option value = ‘#qDept.department_id#’>#qDept.name#</option>
  </cfoutput></select>  
 
  </tr>
  <tr>
    <td>Salary</td>
    <td><input name="salary" type="text"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input name="submit" type="submit" value="Submit"></td>
  </tr>
</table>
</form>

</body>
</html>