Hey,

Just a few issues, I'd like to resolve with the help of willing fellow SitePoint members

Issue 1

I am working on a content management system to make it easy to manage the websites in my new Icelandic free webmaster resources and tips website. So I made up a form that collects information about a website and posts it into the database.

The problem is, that when I make an entry, sometimes the page or MySQL or whatever it is, decides to make 1-3 empty rows in my database and then post the data.

How can I prevent that?
This is the code for the form, and I am using MySQL.

PHP Code:
<form action="insert.php" method="post">
 
<TABLE>
 
<TR><TD>Lřsing sÝ­u</TD><TD><input type="text" name="description" maxchar="255"></TD></TR>
 
<TR><TD>Lykilor­</TD><TD><input type="text" name="keywords" maxchar="255"></TD></TR>
 
<TR><TD>Titill</TD><TD><input type="text" name="title" maxchar="20"></TD></TR>
 
<TR><TD>Efni</TD><TD><textarea name="content"></textarea></TD></TR>
 
<TR><TD>Fˇtur</TD><TD><input type="text" name="footer" maxchar="200"></TD></TR>
 
<TR><TD>Auglřsing</TD><TD><input type="text" name="advertisement" maxchar="70"></TD></TR>
 
<TR><TD>Mynd</TD><TD><input type="text" name="image" maxchar="50"></TD></TR>
 
<TR><TD></TD><TD><input type="Submit" value="Vista"></TD></TR>
 
</TABLE>
 
</form>
 
<?
 
$username
="snilldar_vefur";
 
$password="----beeep-----";
 
$database="snilldar_vefsidugerd";
 
$description=$_POST['description'];
 
$keywords=$_POST['keywords'];
 
$title=$_POST['title'];
 
$content=$_POST['content'];
 
$footer=$_POST['footer'];
 
$advertisement=$_POST['advertisement'];
 
$image=$_POST['image'];
 
mysql_connect(localhost,$username,$password);
 
@
mysql_select_db($database) or die( "Villa vi­ a­ velja gagnagrunn");
 
$query "INSERT INTO vefsida VALUES ('','$description','$keywords','$title','$content','$footer','$advertisement','$image')";
 
mysql_query($query);
 
mysql_close();
 
?>
Issue 2

Issue 2 mainly consist of my lack of knowledge in PHP and MySQL. I'd like to know how I can select invidual rows and make 1 page display all information from a row, so here is my attempt, that doesn't really work:

PHP Code:
 <? 
 
$id
=$_GET['id'];
$username="snilldar_vefur";
$password="----beep------";
$database="snilldar_vefsidugerd";
mysql_connect(localhost,$username,$password);
 
@
mysql_select_db($database) or die( "Gat ekki vali­ gagnagrunn");
 
$query="SELECT * FROM vefsida WHERE id='$id'";
 
$result=mysql_query($query);
 
mysql_close();
 
$description=mysql_result($result,$i,"description");
 
$keywords=mysql_result($result,$i,"keywords");
 
$id=mysql_result($result,$i,"id");
 
$title=mysql_result($result,$i,"title");
 
$content=mysql_result($result,$i,"content");
 
$footer=mysql_result($result,$i,"footer");
 
$advertisement=mysql_result($result,$i,"advertisement");
 
$image=mysql_result($result,$i,"image");
 
?>
 
Title: <?php $title ?>