<?php
require_once('./common/connector/scheduler_connector.php');
$res=mysql_connect("127.0.0.1","root","root");
mysql_select_db("JOOMLA DATABASE");
$conn = new SchedulerConnector($res);
$scheduler->render_table("events","event_id","start_date,end_date,event_name,details");
?>
它包含2个php文件,当我将其连接到另一个数据库中的同一表时,它会创建每小时的时间线,但是当我将其连接到joomla数据库时,如果没有任何结果,有人可以帮助我将其改进为joomla样式
最佳答案
您必须更改代码,因为表名似乎不正确。我不知道SchedulerConnector类,但我想第一个变量是表名
$scheduler->render_table("events","event_id","start_date,end_date,event_name,details");
您需要给正确的表名加上扩展名,例如
$scheduler->render_table("nt29v_events","event_id","start_date,end_date,event_name,details");
如果这是您的表扩展名,则在表名中包括
nt29v_
;当您从外部连接到Joomla数据库时。我检查了课,我明白了
render_table
配置连接器并从单个表中检索数据。
$conn->render_table($table,$id,$text,$extra,$relation);
参数:
$table - the name of a table.
$id - the name of the id field.
$text - a comma separated list of data fields.
$extra - a comma separated list of extra fields, optional.
$relation_id - used for building hierarchy in case of Tree and TreeGrid.
我猜对了
参考:http://docs.dhtmlx.com/connector__php__connector_object_methods.html#rendertable
关于php - 如何访问joomla数据库以运行此代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37871427/