Code:
<?php
//open connection
$conn = mysql_connect("localhost", "root", "password") or die(mysql_error());
//select database
mysql_select_db("test", $conn);
//the sql statement
$sql = "SELECT * FROM articles";
//execute the statement
$data = mysql_query($sql, $conn) or die(mysql_error());
while ($result = mysql_fetch_array($data)) {
//giving names to the fields
$title = $result['title'];
$date = $result['date'];
$info = $result['info'];
$url = $result['url'];
//put the results on the screen
echo "<b>$title</b>";
echo " ";
echo "<b>$date</b><br>";
echo "$info<br>";
echo "$url<br>";
}
?>
HTML Code:
<h2>Search</h2> <form name="search" method="post" action="search1.php"> Seach for: <input type="text" name="find" /> <input type="submit" name="search" value="Search" /> </form>
thanks in advance
