Home arrow MySQL arrow Page 11 - The Perfect Job (part 1)

Filing It All Away - MySQL

Recruitment - the art of matching qualified applications to openpositions within an organization - is one of the most challenging tasks forany Human Resources department. However, powerful open-source tools likePHP and mySQL have made the process simpler, more efficient and moreeconomical than at any time in the past. This case study demonstrates how,by building a complete job listing and resume management system fromscratch.

TABLE OF CONTENTS:
  1. The Perfect Job (part 1)
  2. An Ideal World
  3. Entry Point
  4. Going To The Database
  5. The Five Rs
  6. Lucky Thirteen
  7. Building The Foundation
  8. The Devil Is In The Details
  9. Applying Yourself
  10. Testing Times
  11. Filing It All Away
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 4
June 28, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
At the end of all the validation, the size of the $errorList array is checked. If the size is 0, it implies that no errors were detected, and database insertion begins.

<? // no errors if (sizeof($errorList) == 0) { // insert personal info $query = "INSERT INTO r_user (jcode, fname, lname, dob, addr1, addr2, city, state, zip, fk_country, phone, email, url, relo, posted) VALUES ('$jcode', '$fname', '$lname', '$dob', '$addr1', '$addr2', '$city', '$state', '$zip', '$country', '$phone', '$email', '$url', '$relo', NOW(''))"; $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error()); // get resume id, for use in subsequent operations $rid = mysql_insert_id($connection); // insert educational qualifications for($x=0; $x<sizeof($institute); $x++) { if (!empty($institute[$x]) && !empty($degree_year[$x])) { $query = "INSERT INTO r_education (rid, institute, fk_degree, fk_subject, year) VALUES ('$rid', '$institute[$x]', '$degree[$x]', '$subject[$x]', '$degree_year[$x]')"; $result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error()); } } // and so on // print success code echo "Your application has been accepted.<p><a href=job_list.php> Return to job listings</a>"; } else { // or list errors listErrors(); } ?>
If error messages are present, the listErrors() function is called to display a list of error messages. No database insertion takes place, and the user has the option to return to the previous page to rectify the errors.

<? // produce a list of errors after validating a form function listErrors() { // read the errorList array global $errorList; // print as list echo "The following errors were encountered: <br>"; echo "<ul>"; for ($x=0; $x<sizeof($errorList); $x++) { echo "<li>$errorList[$x]"; } echo "</ul>"; // link to go back and correct errors echo "Click <a href=javascript:history.back();>here</a> to go back to the previous page and correct the errors"; } ?>
At this point, all relevant user information has been stored in the various database tables. This is the end of the user process flow; the focus now shifts to data retrieval and maintenance, both of which are exclusively administrative functions.

In the second part of this article, I'll examine the administration scripts related to adding, editing and deleting job listings, together with a look at a basic search engine to sift through all the data. In the meanwhile, download the code, play with it, send me your thoughts/flames/savings...and come back next time for more!

This article copyright Melonfire 2001. All rights reserved.

 
 
>>> More MySQL Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
   

MYSQL ARTICLES

- Xeround Releases Free Version of MySQL Cloud...
- Oracle Announces New MySQL Specialization
- Constant Contact Chooses SkySQL for MySQL Su...
- Revoke Statement in MySQL
- The Grant Statement in MySQL
- SuccessBricks Announces ClearDB Availability...
- Building a PHP ORM: Deploying a Blog
- TROSYS Launches Free MySQL Manager and Admin...
- Building an ORM in PHP: Domain Modeling
- Building an ORM in PHP
- MySQL Leads Open Source Market, Gets Cluster...
- Oracle Announces Milestone Release for MySQL
- How to Stop SQL Injection Attacks
- New Defragmentation Solution for SQL Server
- Comparison of MyISAM and InnoDB MySQL Databa...


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap

Dev Shed Tutorial Topics: