<?php
mysql_connect("localhost","root","");
mysql_select_db("database_name")
?>
<form name="search" action="">
Search: <input name="q" type="text" /><input name="search" type="submit" value="Search" />
</form>
<?php
if(isset($_GET['q'])){
// include database connection
$sql = "SELECT * FROM article WHERE title LIKE '".$_GET['q']."' ";
$exe = mysql_query($sql);
while($row = mysql_fetch_array($exe)){
}
?>
<table>
<tr>
<td> <a href="article_detail.php?id=<?php echo $row['id'];?>" class="header_menu"> <?php echo $row['title']; ?> </a> </td>
</tr>
</table>
<?php
}
?>
I wrote this code in my php form but this code cannot work. any friend can tell me that what is the problem of this code and how can i correct this code