Jump to content

Search engine Facing problem need Help

- - - - -

  • Please log in to reply
2 replies to this topic

#1
virtualray

virtualray

    Newbie

  • Members
  • Pip
  • 1 posts
Hello
I have created a search engine but im facing the following error
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\vschool\search2.php on line 15

I have created a search form as the following
<html>  

   <head>  

     <meta  http-equiv="Content-Type" content="text/html;  charset=iso-8859-1">   

     <title>Search Contacts</title>  

   </head>  

   <p align="right"><body>   

     <h3 align="right">searching form</h3>  

      

    <form  method="get" action="search2.php"  id="searchform">   

       <p align="right">   

       <input  type="submit" name="submit" value="search"><input  type="text" id="search" name="search"> 

		</p>

     </form>  

  </body>  

</html> 

then i created a page called search2.php with the code below

<?php


$con = mysql_connect("localhost","hashem","hashem");

if (!$con)

  {

  die('Could not connect: ' . mysql_error());

  }

  

  $search = $_GET['search'];

 


mysql_select_db("schoo", $con);


$result = mysql_query("SELECT * FROM persons WHERE MATCH(Number) AGAINST ('$search' IN BOOLEAN MODE )";");


echo "<table border='1'>

<tr>

<th>Name</th>

<th>Grade</th>

<th>Result</th>

</tr>";


while($row = mysql_fetch_array($result))

  {

  echo "<tr>";

  echo "<td>" . $row['Name'] . "</td>";

  echo "<td>" . $row['Grade'] . "</td>";

  echo "<td>" . $row['Result'] . "</td>";

  echo "</tr>";

  }

echo "</table>";


mysql_close($con);

?> 

can you please help with this

regards

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
You have an extra "); at the end of your SQL query row...
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
A syntax highlighter can help, you can even see on the highlighter on these forums, the colouring after the "); is incorrect which must mean some string was not properly formed somewhere.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users