Þetta ætti að virka…
<html>
<head>
<title>Leita í SQL grunni</title>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
</head>
<body bgcolor=“#FFFFFF” text=“#000000”>
<form name=“form1” method=“post” action=“”>
Nafn:<br>
<input type=“text” name=“nafn”>
<br>
Aldur:<br>
<input type=“text” name=“aldur”>
<br>
<br>
<input type=“submit” name=“submit” value=“Leita”>
</form>
</body>
</html>
<?
if($submit)
{
if(!$nafn || !$aldur) die('Þú verður að fylla að minnsta kosti í 1 reit!');
mysql_connect('localhost','notandanafn','lykilord');
mysql_select_db('gagnagrunnur');
$query = mysql_query(“SELECT * FROM tafla WHERE nafn LIKE ‘%$nafn%’ AND aldur LIKE ‘%$aldur%’ ORDER BY id ASC”);
while($myrow = mysql_fetch_array($query)) echo "Nafn: $myrow[nafn]<br>Aldur: $myrow[aldur]<br>Sími: $myrow[simi]<br>Heimilisfang: $myrow[heimilisfang]<br><br>“;
}
?><br><br>
<a href=”mailto:gaui@gaui.is“>gaui@gaui.is</a> / <a href=”
http://www.gaui.is">www.gaui.is</a