Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » updateSelection cannot extract token (updateSelection with multiple SET result in Fatal Error)
updateSelection cannot extract token [message #2916] Sat, 17 March 2012 02:05 Go to previous message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Radicore v1.72.0
Apache Version 2.2.21
PHP Version 5.3.8
MySQL Version 5.5.16

1. Use updateSelection with multiple SET like this:

function _cm_post_updateRecord ($rowdata, $old_data)
{
$a = 1;
$b = 2;
$where = "'{$rowdata['lft']}'<lft AND rgt<'{$rowdata['rgt']}'";
$replace = "lvl='lvl+{$a}', lft='lft+{$b}', rgt='rgt+{$b}'";
this->updateSelection($where, $replace);
return $rowdata;
} // _cm_post_updateRecord

2. Doing the above will result in:

Fatal Error: Cannot extract token from: ', lft='lft+2', rgt='rgt+2'' (# 256).

3. Had to rewrite into something like below in order to avoid this fatal error:

function _cm_post_updateRecord ($rowdata, $old_data)
{
$a = 1;
$b = 2;
$where = "'{$rowdata['lft']}'<lft AND rgt<'{$rowdata['rgt']}'";
$replace = "lvl='lvl+{$a}'";
this->updateSelection($where, $replace);
$replace = "lft='lft+{$b}'";
this->updateSelection($where, $replace);
$replace = "rgt='rgt+{$b}'";
this->updateSelection($where, $replace);
return $rowdata;
} // _cm_post_updateRecord

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: auto_increment
Next Topic: Re-enabling user loses rdcaccount
Goto Forum:
  


Current Time: Mon Jul 22 12:35:03 EDT 2024

Total time taken to generate the page: 0.00913 seconds