Source Code : How to create a semantic search

How to create a semantic search


  //connected to DB

  foreach (array('questioncontent') as $varname) {
  $questioncontent = (isset($_POST[$varname])) ? $_POST[$varname] : '';
  }

  ?>
 

Search for a previous question by entering in a phrase in the search box below and submitting the phrase

Search:

 


    if (isset($_POST['searchQuestion'])) {

  $questionquery = "SELECT QuestionContent FROM Question
  WHERE(QuestionContent = '".mysql_real_escape_string($questioncontent)."')";

  $questionnum = mysql_num_rows($questionresult = mysql_query($questionquery));

  if($questionnum !=0){

  $output = "";

  while ($questionrow = mysql_fetch_array($questionresult)) {

  $output .= "
 
 
 
  ";
  }
  $output .= " 
{$questionrow['QuestionContent']}
";

  echo $output;

  }

  }