<?php
$id = (is_numeric($_GET['id'])) ? $_GET['id'] : 0;
$sql = "SELECT * FROM forum_question WHERE id = $id";
$result = mysql_query($sql);
$result = mysql_fetch_array($result);
if ($result['lock'] == 1){
// content
}
else
{
echo 'TOPIC CLOSED!';
}
?>
Locking functions
Page 1 of 16 Replies - 374 Views - Last Post: 07 June 2011 - 01:46 AM
#1
Locking functions
Posted 07 June 2011 - 01:23 AM
It's working, But the problem is that it locks ALL of my topic's!
Replies To: Locking functions
#2
Re: Locking functions
Posted 07 June 2011 - 01:28 AM
does lock = 1 mean the topic is locked?
#3
Re: Locking functions
Posted 07 June 2011 - 01:29 AM
Yes, If there is an 1 place in value lock, then the topic should display "TOPIC IS LOCKED"
#4
Re: Locking functions
Posted 07 June 2011 - 01:34 AM
currently you’re showing the content if lock = 1 …
#5
Re: Locking functions
Posted 07 June 2011 - 01:38 AM
So it should be != 0??
And how can i set and ID in there so that it will not lock ALL of my topics? just to the one's i assign it to lock.
And how can i set and ID in there so that it will not lock ALL of my topics? just to the one's i assign it to lock.
#6
Re: Locking functions
Posted 07 June 2011 - 01:41 AM
your problem is not in the SQL … lock != 0 is practically the same as lock == 1. you could try lock == 0 …
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|