That's because you send only a query to the database, but don't extract the contents of the result list you get in return. Think of the return value of a succesful mysql_query() as a pointer to a big list of single records. You now have to access each single record and read the values from it's fields.
Assuming that there can only be one possible recordset, I think this might be a quick fix:
PHP Code:
$rs=mysql_query($sql,$conn)
or die("Could not execute query");
if ($rs && mysql_num_rows($rs) > 0) {
$row = mysql_fetch_assoc($rs);
$id = $row['id'];
}
Check the manual sections about mysql_fetch_array(), mysql_fetch_assoc(), mysql_fetch_row() and mysql_fetch_object() to get an impression how you can retrieve the single records from a MySQL resource.