By: C J Cockrell
Date: 2006-06-17
Time: 11:57
|
ByPage problem with MySQL data
I got the following errors when using MySQL data and a PHP script that used the 'bypage' plugin. These are the messages:
>---start
TBS:function DataOpen
TBS:Query: SELECT id,name,comment FROM equipment
TBS:function meth_Merge_BlockSections
TBS:function meth_PlugIn_RunAll
TBS_BYPAGE: function BeforeMergeBlock
TBS:function DataFetch
TBS:function DataFetch
TBS:function DataFetch
TBS:function DataFetch
TBS:function DataFetch
TBS:function DataClose
TBS:function DataOpen
TBS:Query:
TBS:function DataFetch
TBS:function meth_Merge_SectionNormal
TBS:function meth_Locator_Replace
TBS:function meth_Misc_Alert
TinyButStrong Error in field [blk1.comment...] : item 'comment' is not an existing key in the array. This message can be cancelled using parameter 'noerr'.
TBS:function meth_Conv_Html
TBS:function meth_Locator_Replace
TBS:function meth_Misc_Alert
TinyButStrong Error in field [blk1.name...] : item 'name' is not an existing key in the array. This message can be cancelled using parameter 'noerr'.
TBS:function meth_Conv_Html
TBS:function meth_Locator_Replace
TBS:function meth_Misc_Alert
TinyButStrong Error in field [blk1.id...] : item 'id' is not an existing key in the array. This message can be cancelled using parameter 'noerr'.
>---end
(the lines with TBS: and TBS_BYPAGE: are just extra logging output I added to your code in TBS and into the plugin).
tbs_plugin_bypage.php makes a call to DataOpen with an empty string instead of the SQL query (as shown in the log output).
These messages are only output when displaying page 1, and 1 record less than requested is output in the table. On succeeding pages, the table is produced okay, but offset by one row. So if I want to display 3 rows/page, I expect rows 4,5,6 on page 2, but get rows 3,4,5.
So far as I can see, I am following the example (here is the php code for the page):
>---start
<?php
include_once('tbs/tbs_class_php5.php') ;
include_once('tbs/tbs_plugin_bypage.php');
if (!isset($_SERVER)) $_SERVER=&$HTTP_SERVER_VARS ; //PHP<4.1.0
require($_SERVER['DOCUMENT_ROOT'].'/connect.php');
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('templates/equipment_tbs.html') ;
$TBS->PlugIn(TBS_BYPAGE,3,1);
$TBS->MergeBlock('blk1',$connection,'SELECT id,name,comment FROM equipment') ;
mysql_close($connection) ;
$TBS->Show() ;
?>
>---end
Can you help with this one?
|
By: Skrol29
Date: 2006-06-17
Time: 18:06
|
Re: ByPage problem with MySQL data
Hello,
There is an update for this plugin. It is now version 1.0.3 which goes with TBS => 3.1.0.
If you don't have this version, you can download it with the TBS stantard distribution.
|
By: C J Cockrell
Date: 2006-06-17
Time: 21:40
|
Re: ByPage problem with MySQL data
Yes, that fixes it. Thanks very much! You have a very interesting application here, which I am enjoying exploring.
|