$sid=1; $sql = "SELECT link FROM tabletest where id= \'$sid\'"; $result = mysql_query($sql); $row = mysql_fetch_row($result); echo "$row[0]";