PHP Example
Screen shot
index.php

<?php
$con=mysql_connect('localhost','root','') or die("Mysql not connected");
mysql_select_db('test',$con) or die("Database not connected");
?>
<html>
<head>
<title>Student Result</title>
<script type="text/javascript">

function blank(a) {
if(a.value == a.defaultValue)
a.value = "";
}

function unblank(a) {
if(a.value == "")
a.value = a.defaultValue;
}

</script>
</head>
<body>
<table width="400" border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center">
<form name="frm" action="" method="post">
<input name="keyword" type="text" value="keyword" onFocus="blank(this)"  style="width:200px;" onBlur="unblank(this)"/>
<input name="btn" type="submit" value="Search" />
</form>
</td>
</tr>
<?php
if(isset($_POST['btn']))
{
$keyword=$_POST['keyword'];
$query="select * from news where description like '%$keyword%'";
$result=mysql_query($query);
$rows=mysql_num_rows($result);
if($rows==0)
{
?>
<tr>
<td colspan="2" align="center"><?php echo "No result found"; ?></td>
</tr>
<?php
}
else
{
while($data=mysql_fetch_array($result))
{
?>
<tr>
<td align="left">
<?php
echo "<b>".$data['title']."</b><br>".$data['description']."<br>";
?>
</td>
</tr>
<?php
}
}
}
?>
</table>
</body>
</html>

Database

-- Database: `test`

-- Table structure for table `news`

CREATE TABLE IF NOT EXISTS `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `description` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- Dumping data for table `news`

INSERT INTO `news` (`id`, `title`, `description`) VALUES
(1, 'PHP Training in delhi', 'We are providing php training in delhi and noida location. our course content is as \r\nflowes: php & mysql, Javascript, Ajax, Joomla, Wordpress'),
(2, 'seo training in delhi', 'our seo training in luxmi nager in delhi and our branch is janakpuri also.'),
(3, 'php training in noida', 'we are providing php training in delhi and lucknow. we fee is 8000/- only');


You can download source code here