I've been to many different tutorials and I never get this thing working... I just want to enter some data into a database, how hard can it be???

I posted a topic a while ago with some php code that didn't work... and now I've been looking at some other solutions to the problem... a few look a lot like and this is one of them..

this is inserted to a html page:
--------------------------------
<form name="links" method="post" action="add_links.php">
<p>Title :
<input type="text" name="title">
<br>
<br>
URL :
<input type="text" name="url">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p></form>
--------------------------------
and is linked to add_links.php
add_links.php looks like this:
--------------------------------
<?php
$db = mysql_connect("localhost","user","password");
mysql_select_db (database name);
$query = "INSERT INTO links(title , url)
VALUES('$title','$url')";
$result = mysql_query($query);
echo ("Link entered.");
?>
--------------------------------
now, what happens is that the database is updated (wich is a step in the right direction). but only the $id is updated... nothing else is entered into the database... I had a similar code and the same thing happened there.. only the id was entered...
--------------------------------
the table "links":
(
id mediumint(10) NOT NULL auto_increment,
title varchar(80),
url varchar(80),
PRIMARY KEY (id)
)
--------------------------------
and if you wanna know, I'm not just looking to steal some code, I wanna know how it works.

this is the code I copy and just change "($result2,0,"txt")" to "($result2,1,"txt")" and so on...

and another thing, for another thing...
I'm thinking of using php on other places on the site... and there's a list that I'd like to have every second line in a different color... is that possible to do at one place or do I have to make up a table and set the color on everyone... it should be first a white background, then a grey, then another white and then another grey. and so on... and here I really would need to have one code to list all entrys because the number of entrys will change...

Post the piece of code where the Mysql query is, so we can have a look

Anyway:
$result is the variable that contents the query and you use mysql_fetch_array to itinerate through all rows. Then use echo $row[0]; (or $row["my_row_name"]; ) to get the values of the named row/s.

what am I doing wrong? this code used to work... but I moved it around and at the beginning it was split up on two pages... and now it don't work... is it the --- action="<?php echo $PHP_SELF?>"> --- thing that screws thing up? coz that's the only thing I can think of... (it's 5am, so I might have missed a couple of things though) and I don't know how to do the php_self thing...