I have a node in drupal. I want to be able to input a node id and then then have it output a single comment id which was made on that node. How would I go about doing this? Thank you.
$mycid = db_fetch_object(db_query('SELECT * FROM {comments} WHERE nid = %d ORDER BY RAND() LIMIT 1', $mynid));
return theme_comment_view($mycid,$mynid);
$mynid is your node id to load. This code will take your node id and render a random comment from that node's comments.
Check here.
Do you want this to be its own page? On the node's page? In a block? Do you want a particular comment or just a random one? How do you want to 'input' the node id?
For most of the cases, I'd probably do this with the Views module. When you create a view, you can set the type to 'comment', set your filters/arguments to the particular node/node type and limit it to a single comment. If you want a page or a block, views can simply create them for you. If you want to display the whole comment or just parts of it, Views can take care of that. If you want to embed them in some other page, it's still relatively easy to to embed a view in another page through PHP.