Untested but... try something like this:
<?php
$search = $_REQUEST["search"];
echo "Searching for: $search<br>";
#strip search of tags
$search = strip_tags($search, "<b><i>");
// Set Connect String
$server = "localhost";
$username = "sad";
$password = "sadd";
$dbname = "ags";
// Connect to Database
$sqlconnect = mysql_connect($server, $username, $password) or die ("no connect $sqlconnect");
$int_db = mysql_select_db("$dbname",$sqlconnect);
if (!$int_db) {
print "could not select database $dbname.<br>Server:$server<br>Username:$username<br>Passowrd:$password";
}
$query = "SELECT DISTINCT * from article WHERE body LIKE '%$search%' ORDER BY datex DESC";
$result = mysql_query($query);
while ($row = mysql_fetch_object($result)) {
echo "<table border=\"2\" width=\"375\">";
echo "<tr>\n<td><b>Author:</b>";
echo $row->author;
echo "</td>\n<td><b>Title:</b>";
echo $row->title;
echo "</td></tr>\n<tr><td colspan=\"2\">";
$datetime = $row->datex;
$year = substr( $datetime, 0, 4 );
$mon = substr( $datetime, 4, 2 );
$day = substr( $datetime, 6, 2 );
$hour = substr( $datetime, 8, 2 );
$min = substr( $datetime, 10, 2 );
$sec = substr( $datetime, 12, 2 );
$orgdate = date("l F dS, Y h:i A",mktime( $hour, $min, $sec, $mon, $day, $year ) );
echo "<b>Date: </b>";
echo $row->orgdate;
echo "</td></tr>\n<tr><td colspan=\"2\"><b>Text:</b>";
echo $row->text;
echo "</td></tr></table><br>";
}
?>
Once you get it working you may want to look into SQL Injection and mysql_real_escape_string();