hi guys,
i have found this through my study. i followed the instructions from
this link http://code.google.com/p/mc-goog-visualization/wiki/UserDocumentation
and downloaded its package but still, i encountered errors. i think
this code causes error
?php
require_once 'MC/Google/Visualization.php';
$db=new PDO ('mysql:host=localhost;database=pelopsx', 'root',
'admin');
$vis = new MC_Google_Visualization($db, 'mysql');
$vis->addEntity('dlogs', array(
'dlogs'=>array(
'col1'=>array('cal','number'),
'col2'=> array('met','number')
)
));
$vis->handleRequest();
?>
its error is
Notice (8): Undefined index: table [APP/MC/Google/Visualization.php,
line 785]
Code | Context
*/
public function addEntity($name, $spec=array()) {
$entity = array('table' => ($spec['table']) ? $spec['table'] : $name,
'fields' => array(), 'joins' => array());
$name = "dlogs"
$spec = array(
"dlogs" => array(
"col1" => array(),
"col2" => array()
)
)
MC_Google_Visualization::addEntity() - APP/MC/Google/
Visualization.php, line 785
include - APP/views/pages/test1.ctp, line 49
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
Notice (8): Undefined index: tq [APP/MC/Google/Visualization.php, line
136]
Code
*/
public function handleRequest() {
$query = $_GET['tq'];
MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 136
include - APP/views/pages/test1.ctp, line 51
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
Notice (8): Undefined index: tqx [APP/MC/Google/Visualization.php,
line 138]
Code | Context
$query = $_GET['tq'];
$params = array('version' => $this->version, 'responseHandler' =>
'google.visualization.Query.setResponse');
$paramlist = explode(';', $_GET['tqx']);
$query = null
$params = array(
"version" => 0.5,
"responseHandler" => "google.visualization.Query.setResponse"
)
MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 138
include - APP/views/pages/test1.ctp, line 51
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
Notice (8): Undefined offset: 1 [APP/MC/Google/Visualization.php, line
140]
Code | Context
$paramlist = explode(';', $_GET['tqx']);
foreach($paramlist as $paramstr) {
list($name, $val) = explode(':', $paramstr);
$query = null
$params = array(
"version" => 0.5,
"responseHandler" => "google.visualization.Query.setResponse"
)
$paramlist = array(
""
)
$paramstr = ""
MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 140
include - APP/views/pages/test1.ctp, line 51
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
Notice (8): Undefined index: reqId [APP/MC/Google/Visualization.php,
line 144]
Code | Context
}
$params['reqId'] = (int) $params['reqId'];
$query = null
$params = array(
"version" => 0.5,
"responseHandler" => "google.visualization.Query.setResponse",
"" => null
)
$paramlist = array(
""
)
$paramstr = ""
$val = null
$name = ""
MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 144
include - APP/views/pages/test1.ctp, line 51
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
Notice (8): Uninitialized string offset: 0 [APP/MC/Parser/Def.php,
line 58]
Code | Context
list($loc, $tok) = $this->_parse($str, $loc);
$char = $str[$loc++];
$str = ""
$loc = 1
$tok = null
MC_Parser_Def::parsePart() - APP/MC/Parser/Def.php, line 58
MC_Parser_Def_OneOf::_parse() - APP/MC/Parser/Def/OneOf.php, line 40
MC_Parser_Def::parsePart() - APP/MC/Parser/Def.php, line 56
MC_Parser_Def_Set::_parse() - APP/MC/Parser/Def/Set.php, line 38
MC_Parser_Def::parsePart() - APP/MC/Parser/Def.php, line 56
MC_Parser_Def::parse() - APP/MC/Parser/Def.php, line 42
MC_Google_Visualization::parseQuery() - APP/MC/Google/
Visualization.php, line 671
MC_Google_Visualization::handleQuery() - APP/MC/Google/
Visualization.php, line 169
MC_Google_Visualization::handleRequest() - APP/MC/Google/
Visualization.php, line 154
include - APP/views/pages/test1.ctp, line 51
View::_render() - CORE/cake/libs/view/view.php, line 718
View::render() - CORE/cake/libs/view/view.php, line 417
Controller::render() - CORE/cake/libs/controller/controller.php, line
861
PagesController::display() - CORE/cake/libs/controller/
pages_controller.php, line 88
Object::dispatchMethod() - CORE/cake/libs/object.php, line 125
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 240
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 206
[main] - APP/webroot/index.php, line 83
google.visualization.Query.setResponse({version:"0.5"reqId:"0",status:"error",errors:
[{reason:"server_error",message:"Server Error",detailed_message:"FROM
clauses are required if no default entity is defined"}]});
as you can see, it contains huge error. i tried to understand and edit
it but still, i obtain more errors.
i will be using the database pelopsx with the table dlogs that has
fields of id, timestamp, cal, and met.
can you please help me?..
any help is highly appreciated. thanks
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php