yes, that's the format i was using.
<?php
$searchstring=trim($searchstring);
if ($searchstring){
$sql="SELECT * FROM my_table WHERE $searchtype LIKE '%$searchstring%'";
$db = mysql_connect("localhost", "......", "...........");
mysql_select_db("my_db",$db);
$result = mysql_query($sql,$db);
while ($myrow = mysql_fetch_array($result))
{
echo_the_results;
}
}
else
{
?>
some_html_code
<?php
}
?>
</HTML>