-3
include 'connect.php';
msql_select_db("u972015033_jobss"); or die("Could not find DB");
if(isset($_POST['search'])){
    $searchq = $_POST['search'];
    $query = msql_query("SELECT * FROM job_search WHERE job_name LIKE '%$searchq%'"); or die("Could not find");
    $count = mysql_num_rows($query);
    if($count == 0){
        $output = 'There was no results found';
        else{
            while($row = mysql_fetch_array($query)){
                $jobname = $row['job_name'];
                $jobdesc = $row['job_desc'];
                $jobcomp = $row['job_company'];
                $output .= '<div> '.$jobname.' '.$jobdesc.' '.$jobcomp.'</div>';
                echo = "$output";
            }
        }
    }
}

I dont know what is the problem please help Its a basic script to query a database and display the output

Sooryah Prasath
  • 59
  • 1
  • 1
  • 3

1 Answers1

0

Here is the list of error:

  1. msql_select_db("u972015033_jobss"); or die("Could not find DB"); // it should be mysql_select_db("u972015033_jobss") or die("Could not find DB");
  2. $query = msql_query("SELECT * FROM job_search WHERE job_name LIKE '%$searchq%'"); or die("Could not find"); //must be: $query = mysql_query("SELECT * FROM job_search WHERE job_name LIKE '%$searchq%'") or die("Could not find");
  3. before else close '}'
  4. echo = "$output"; //remove the "="
Dipanwita Kundu
  • 1,637
  • 1
  • 9
  • 14
  • that's basically what I said also, but with a small difference: I don't think he's missing the closing curly brace, he placed it in the wrong place, after the entire block – mishu Oct 03 '16 at 07:55
  • @mishu, Yes you are right. I did not notice your comment – Dipanwita Kundu Oct 03 '16 at 08:10