Trying to select the minimum post_id from the posts table in my database (to get the id of the first post in a topic) but I can't get the mysql query to work right.
I've got
$postidquery=mysql_query("SELECT MIN(post_id) FROM posts WHERE topic_id='$topic'",$db);
but I get no results...
If I run
$postidquery=mysql_query("SELECT post_id FROM posts WHERE topic_id='$topic'",$db);
I get no errors and I can get the largest by running it in a while loop and it finishes, then prints out the last value, but I need the first one!
Thanks for any help!