I want to prevent users from commenting on deleted threads.
I’ve set a variable (let’s call it ‘tnum’) to identify the original thread and its comments, so I can display them in a same web page.
When I delete a thread, the original thread and all comments get deleted at once
(delete from ~ where tnum is ~)
So I think I can prevent comment submission on deleted threads using that.
I want to put out an error message when there is no row in table with certain tnum value.
if( 'some code' ) {
error("There is no data for the thread.");
}
Could someone help me with this?
Thanks.
You can use COUNT() in MySQL to get the number of rows that match your criteria. So something like this