This topic is locked
[SOLVED]

 PHPrunner 8.0 Error

7/23/2014 12:04:24 PM
PHPRunner General questions
T
taumic author

In PHPrunner 7.1 the following code from the HELP-File work great:
Example 3

Display the record counter for each menu item. The code will validate if the menu item is an internal table or view and will concatenate the number of records with the menu item name.

Menu Item: Modify event



if ($menuItem->getLinkType() == "Internal" && $menuItem->getPageType() != "WebReports")

{

$settings = new ProjectSettings($menuItem->getTable());

$table = $settings->getOriginalTableName();

$rs=CustomQuery("select count(*) as c from " . AddTableWrappers($table));

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c"] . ")");

}

return true;


In PHPrunner_80 I get this error message:
php ... Fehler ist aufgetreten

Technische Information

Fehlertyp 256

Fehlerbeschreibung Incorrect table name ''

URL localhost/TauppNet80/menu.php?

Fehlerdatei D:\xampp\htdocs\TauppNet80\connections\MySQLConnection.php

Fehlerzeile 120

SQL Abfrage select count(*) as c from ``
Can you help me please?
Thank you
Taumic

Sergey Kornilov admin 7/23/2014

We haven't updated the manual with new code samples yet. There will be some changes.

T
taumic author 9/15/2014

Now the manual is updated. But there is a feature in connection with dashboards. Please add

&& $menuItem->getPageType() != "Dashboard"

as you can see, otherwise you get the error, that the table "Dashboardname" does not exist.

I hope it helps someone <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=75663&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Taumic



if($menuItem->getLinkType() == 'Internal' && $menuItem->getPageType() != "Dashboard")

{

global $tables_data;

$table=$menuItem->getTable();

include_once(getabspath("include/".GetTableURL($table)."_settings.php"));

$ps = new ProjectSettings($table);

$table= $ps->getOriginalTableName();

$rs=CustomQuery("select count(*) as c from " . AddTableWrappers($table));

$data = db_fetch_array($rs);

$menuItem->setTitle($menuItem->getTitle() . " (". $data["c"] . ")");

}
return true;