Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

unique job.php page error

By: a guest on Nov 25th, 2013  |  syntax: None  |  size: 1.90 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. error_reporting(-1);
  3. ini_set('display_errors', 'On');
  4. ?>
  5.  
  6. <?php
  7.  
  8. $title = "Job Role Description";
  9.  
  10. include ( 'includes/header.php' );
  11.  
  12. ?>
  13. </head>
  14. <body>
  15. <div id="container">
  16.  
  17.  <?php
  18. /*
  19.         VIEW.PHP
  20.         Displays all data from 'jobs' table
  21. */
  22.  
  23.         // connect to the database
  24.         //include('connect-db.php');
  25.                 $con = mysqli_connect("","","","");
  26.  
  27.         // get results from database
  28.                 $id = '';
  29. if(isset($_GET['id'])){ $id = $_GET['id'];}
  30.                
  31.         $query = "SELECT id, ref, role, division, location, salary, description FROM jobs WHERE division='IT' AND id = " . ((!empty($id)) ? $id : "(SELECT min(id) from jobs)") . " ORDER BY id desc LIMIT 1";
  32.                
  33.         $result = mysqli_query($con, $query) or die("Error: ".mysqli_error($con));
  34.  
  35. // display data in table
  36.  
  37.         // loop through results of database query, displaying them in the table
  38.         while($row = mysqli_fetch_array( $result )) {
  39.                        
  40.                 // echo out the contents of each row into a table
  41.                 echo "<table border='1' cellpadding='10' class='jobpagetable'>";
  42. echo "<tr><th class='jobpage'>Ref</th><td>". $row['ref'] . "</td></tr>";
  43. echo '<tr></tr><tr></tr>';
  44.                 echo "<tr><th class='jobs'>Role</th><td>" . $row['role'] . '</td></tr>';
  45. echo '<tr></tr><tr></tr>';
  46. echo "<tr><th class='jobs'>Division</th><td>" . $row['division'] . '</td></tr>';
  47. echo '<tr></tr><tr></tr>';
  48. echo "<tr><th class='jobs'>Location</th><td>" . $row['location'] . '</td></tr>';
  49. echo '<tr></tr><tr></tr>';
  50. echo "<tr><th class='jobs'>Salary</th><td>" . $row['salary'] . '</td></tr>';
  51. echo '<tr></tr><tr></tr>';
  52. echo "<tr><th class='jobs'>Description</th><td>" . $row['description'] . '</td></tr>';
  53. echo '<tr></tr><tr></tr>';
  54. echo "<td><a class='applylinks' href='apply.php?id=" .$row['id']."'>Apply</a></td>";
  55. echo "</tr>";
  56. }
  57. // close table>
  58.         echo "</table>";
  59. ?>
  60.  
  61. </div>
  62. </body>
  63. </html>