This topic is locked

Locking a record

5/23/2009 12:19:35 PM
PHPRunner General questions
N
nitro23456 author

Hi
I am trying to get this to work, so that if my field called 'MY FIELD' contains any information at all it will will echo a message of "already edited" on the page, but if it is empty it will inline edit or edit as usual:

global $conn;

$str = "select MY FIELD from MY TABLE where ID=".$_REQUEST["editid1"];

$rs = db_query($str,$conn);

$data = db_fqtch_array($rs);
if ($data["MY FIELD"]==true)

{

echo "already edited";

exit();

}

else

{
}


Currently, with this code, it doesnt echo if the field is full..... it also wont let me inline edit if it is empty either! help.

S
swanside 5/23/2009

Is it becasue you have echo ""already edited";
and not echo "already edited";
Not too sure, just what I saw in your code.

N
nitro23456 author 5/24/2009

Thanks for your reply, but thats not it.... just a typo on this page!
edited.

S
swanside 5/24/2009

Is it something to do with having exit then else?
I thought If statements worked:
if Bla bla bal
else
exit

J
Jane 5/25/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.