Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- $host="localhost"; // Host name
- $username="root"; // Mysql username
- $password=""; // Mysql password
- $db_name="test1"; // Database name
- $tbl_name="postjob"; // Table name
- // Create connection
- $conn = new mysqli($host, $username, $password);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- $dbconn = mysqli_select_db($conn, $db_name) or die(mysql_error());
- echo $dbconn;
- echo "Connected to Database<br />";
- $output = '';
- $keywords=$_POST['keywords'];
- $location=$_POST['location'];
- $keywords = mysqli_real_escape_string($conn, $keywords);
- $location = mysqli_real_escape_string($conn, $location);
- $sql="SELECT * FROM $tbl_name WHERE job_title LIKE '%$keywords%' OR job_type
- LIKE '%$keywords%' OR job_category LIKE '%$keywords%' OR job_tags LIKE
- '%$keywords%' OR description LIKE '%$keywords%' OR company_name LIKE
- '%$keywords%' OR location LIKE'%$location%'";
- $result=mysqli_query($conn, $sql);
- $count=mysqli_num_rows($result);
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Sign Up</title>
- </head>
- <body>
- <section class="content_area">
- <div class="banner">
- <div class ="result">
- <table>
- <tr>
- <?php
- while($jobsearch=mysqli_fetch_assoc($result)) {
- echo "<tr>";
- echo "<td>"."<h3>".$jobsearch['job_title']."</h3>"."
- <br>".$jobsearch['company_name']."<br>".$jobsearch['description']."</td>";
- echo "</tr>";
- }
- ?>
- </tr>
- </table>
- </div>
- </div>
- </section>
- </body>
- </html>
- <?php
- while($jobsearch=mysqli_fetch_assoc($result)) {
- echo "<div>"."<h3>".$jobsearch['job_title']."</h3>"."
- <br>".$jobsearch['company_name']."<br>".$jobsearch['description'].
- </div>";
- }
- ?>
- job_title
- company_name
- description
- <button>Apply</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement