mysql_real_escape_string will essentially add the escape character () to quotes (amongst a few others) in a string:
$string = "this 'is a test'";
// this \'is a test \'
Strip tags will remove < and >s from the string - basically, html tags.
$test = '<p>this is a test</p>';
// this is a test
You want to use mysql_real_escape_string on data to prep it for insert in the database. Then probably stripslashes() before echoing it to the browser.
magic_quotes_gpc throws a monkey wrench (odd saying) in to the whole thing, but lets ignore I said that for now
Personally, my advice though. If you're just starting out with php don't bother spending too much time on the mysql drivers. They've been replaced by mysqli (i as in 'improved') and php's own PDO. mysql is in the process of being depreciated. Look for PDO tutorials... it may seem a little abstract at first but will make your life easier in the long run - for example, PDO takes care of all the escape string stuff for you.
There's a ton of mysql tutorials out there and most of them, expectedly, are quite out-dated. At this point they do a disservice.