I want to know whether many people can access the site at the same time if I setup one site using the code generated by phprunner. I find some column can't be edit at the same time, they are empty.....after save. Could you please help to give more advise asap? Thanks & Best Regards, Sunrise
add new field to the table, for example blockfield. Setup blockfield to 1 if record is edited now.
check value of this field in the Edit page: Before process event on the Events tab.
Here is a sample:
global $conn,$strTableName;
$str = "select blockfield from ".$strTableName." where RecordID=".$_REQUEST["editid1"];
$rs = db_query($str,$conn);
$data = db_fetch_array($rs);
if ($data["blockfield"]==1)
{
//record is edited now
header("Location: TableName_list.php");
exit();
}
else
{
//setup blockfield to 1
$strUpdate = "update ".$strTableName." set blockfield=1 where RecordID=".$_REQUEST["editid1"];
db_exec($strUpdate,$conn);
}
where RecordID and blockfield are your actual field names, TableName is your actual table name.
J
jomppa102/4/2008
Hi,
you can do the following:
add new field to the table, for example blockfield. Setup blockfield to 1 if record is edited now.
check value of this field in the Edit page: Before process event on the Events tab.
Here is a sample: where RecordID and blockfield are your actual field names, TableName is your actual table name.
Hi, what is the best option to set the blockfield back to 0. I can use after edit event for this but sometimes people are leaving the edit page without saving by just closing the window. best regards
Jouni
J
Jane2/5/2008
Jouni, as workaround you can add another field (StartBlockTime) and save current time in the field in the Edit page: Before process event.
Then check value of this field in the List page: Before process event and setup blockfield=0 for all records where difference between this value and current time is more then 15 minutes for example.