A Few CMSB Errors

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 3, 2013   (RSS)

Hello, All

I've noticed a couple of errors creeping into the cmsb code. The first 2 were revealed when I created a new Single Record editor. Whenever I try to save my changes the following errors appear:

Notice: Undefined index:  _listPage in /path/cmsb/lib/menus/database/editTable_functions.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /path/cmsb/lib/menus/database/editTable_functions.php:218) in /path/cmsb/lib/menus/header.php on line 2



Another completely unconnected issue concerns mysql_get. I often use a piece of code like this:

$thisCategory = mysql_get('category',$record['recordCategory']);


However, this has started causing an error:

mysql_get: second argument must be numeric or null, not ' 5 '!

As you can see, there are spaces around the number. In order to get it to work you have to add a trim function:

$thisCategory = mysql_get('category',trim($record['recordCategory']));


It never used to be like this.

:0(

Perch

Hi Perch,

Could you post or attach your code that is causing the first error for me? 

The second error is most likely happening because the $record['recordCategory'] doesn't contain a numeric value. What happens if you use the showme function to display the recordCategory contents? 

showme($record['recordCategory']); 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Hi, Greg -

The $record['recordCategory'] does contain a numeric value - but the spaces around it are turning it into a string.

When I run:

showme($record['recordCategory']);

It shows this in the code:

<xmp> 5 </xmp>

:0/

Perch