firstly, read the manual section on [man]mysql[/man]
second, do something like this
$link = mysql_connect($dbhost, $dbuser, $dbpass); // connect to db server
mysql_select_db($dbname); // select the database
$sql = "SELECT * FROM clans WHERE id = '$id'"; // query the db for that id
$result = mysql_query($sql); // execute the query
$row = mysql_fetch_assoc($result); // fetch the details
echo $row['id']; // echo the id of the fetched record
echo $row['name']; // echo the name of the fetched record