Skip navigation links

MySQL Forums :: PHP :: Full text search


Advanced Search

Full text search
Posted by: Thomas Hengstl ()
Date: December 24, 2012 03:15PM

Hi,
I am trying to create a full text search with a seach field. I can't find the mistake in my code. Can somebody help me?
_____________________________________
<html>
<head>
</head>
<body>

<form action="this.php?">

<input type="text" name="keyword">

<input type="submit" value="submit">

</form>
<?php

$con = mysql_connect("localhost","user","password");
if (!$con){
die("Can not connect: " . mysql_error());
} else echo "Connection successfull" . "<br />" ;

mysql_select_db ("AN-index",$con);
if(isset($_POST['submit'])){
$sql = "SELECT * FROM Notes WHERE MATCH (Abstract, Homepage_title) AGAINST('$keyword')";
$mydata = mysql_query($sql);

while($record = mysql_fetch_array ($mydata)){
echo $record [Homepage_title];
echo "<br />";
echo "Test";
}
};


?>
</body>
</html>

Options: ReplyQuote


Subject Written By Posted
Full text search Thomas Hengstl 12/24/2012 03:15PM
Re: Full text search Rick James 12/26/2012 12:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.