edit form.php question

R

Rob

Guest
hello,

Im trying to lock a table when the edit option is selected from the results
list. I'm editing the form.php.
I believe I'm in the right spot.

"form.php":

case "edit":
if ($enable_edit == "1"){
// build the details select query
// My lock stuff
mysql_query( "LOCK TABLES table WRITE" );

$sql = "select * from ".$quote."$table_name".$quote." where
".$quote."$where_field".$quote." = '$where_value'";

But when I pull up the page to edit it I get this messge in the footer section:

Message:
Error during query execution.
select `allowed_table` from `dadabik_table_list` where `name_table` =
'tablename'
MySQL server said: Table 'dadabik_table_list' was not locked with LOCK TABLES

======

So Now I'm thinking I need to edit business_logic.php?

I'm looking at the function "update_record" in business_logic.php, but I
dont see where that does the initial select statement to get the record
that is going to be updated... Help....

Thanks
rob

 
E

Eugenio

Guest
Rob wrote:

> hello,
>
> Im trying to lock a table when the edit option is selected
> from the results
> list. I'm editing the form.php.
> I believe I'm in the right spot.
>
> "form.php":
>
> case "edit":
> if ($enable_edit == "1"){
> // build the details select query
> // My lock stuff
> mysql_query( "LOCK TABLES table WRITE" );
>
> $sql = "select * from ".$quote."$table_name".$quote." where
> ".$quote."$where_field".$quote." = '$where_value'";
>
> But when I pull up the page to edit it I get this messge in
> the footer section:
>
> Message:
> Error during query execution.
> select `allowed_table` from `dadabik_table_list` where
> `name_table` =
> 'tablename'
> MySQL server said: Table 'dadabik_table_list' was not locked
> with LOCK TABLES

Mmh, I can't get the meaning....if the table was not locked why it is not possible to select it?

> So Now I'm thinking I need to edit business_logic.php?
>
> I'm looking at the function "update_record" in
> business_logic.php, but I
> dont see where that does the initial select statement to get
> the record
> that is going to be updated... Help....

The update_record() function just update the record according to the values coming from POST, the select query is the one you have highlighted, case "edit" of the form.php page.



(Latest version of DaDaBIK when this message was posted: 3.0 beta)
 
Top