小编Cla*_*ssa的帖子

与Zend Framework中的Firebird适配器的数据库连接

我刚刚开始了解ZF和Firebird,因为我被分配了一个项目.我一直试图在两者之间建立联系,但我还没有成功.我用PDO_Mysql尝试了ZF,它运行得很好,因为它与PHP的Firebird连接(出自ZF),但当我尝试在ZF中与Firebird适配器建立连接时,它会一直显示各种错误.

所以,只是为了检查.要使用Firebird在ZF中建立连接,应该使用我在application.ini中配置的适配器(Firebird.php)来完成连接.我在application.ini中有这样的东西:

**resources.db.adapter = "Firebird"
resources.db.params.host = "localhost"
resources.db.params.dbname =  "C:/wamp/www/WebTH/application/data/THDATA.gdb"
resources.db.params.username = "sysdba"
resources.db.params.password = "masterkey"**
Run Code Online (Sandbox Code Playgroud)

结果错误: ...Firebird.php): failed to open stream: No such file or directory in ...\Loader.php

我还看到需要在Bootstrap.php中添加一个函数.如果我在bootstrap.php中添加函数initDb,如下所示:

 **protected function _initDb()
{
    $this->bootstrap('config');
    $config = $this->getResource('config');
    $db = Zend_Db::factory('Firebird', array(
        'host' => $config->Database->Server,
        'username' => $config->Database->Username,
        'password' => $config->Database->Password,
        'dbname' => $config->Database->DBName,
        'adapterNamespace' => 'ZendX_Db_Adapter'
    ));
    return $db;
}**
Run Code Online (Sandbox Code Playgroud)

我收到错误: ...Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "config" not found' in ...\BootstrapAbstract.php

我想知道为了使连接正常工作我真正需要做什么.很抱歉,如果这太明显了,但我找不到Zend Framework和Firebird特有的基本连接案例,因此我不确定应该做什么以及应该去哪里.

firebird interbase database-connection zend-framework

5
推荐指数
1
解决办法
1497
查看次数

JQPlot:绘制来自外部源的系列和标签

我正在使用JQPlot生成一个从数据库中提取数据的图表,例如http://www.jqplot.com/tests/data-renderers.php中的示例.

图表工作正常,但目前系列标签是硬编码的.如何使此图表显示数据库中的系列标签,就像系列一样?我假设我需要对包含标签名称的第二个文件进行新的调用,但我不确定该怎么做.有任何想法吗?

这是我正在使用的代码:

$(document).ready(function(){
var ajaxDataRenderer = function(url, plot) {
    var ret = null;
    $.ajax({
        async: false,
        url: url,
        dataType:'json',
        success: function(data) {
            ret = data;
        }
    });
   return ret;
};
var jsonurl = "./index.php";
$.jqplot.config.enablePlugins = true;
plot1 = $.jqplot('chart1', jsonurl,{
    dataRenderer: ajaxDataRenderer,
    title: 'Annual Balance Summary',
    legend: {show:true, renderer:$.jqplot.EnhancedLegendRenderer},
    seriesDefaults: {lineWidth:4},
    **series:[{label:'Tilikausi 01/2009 - 12/2009'}, {label:'Tilikausi 01/2010 - 12/2010'}, {label:'Tilikausi 01/2011 - 12/2011'}]**, // THIS ARE THE VALUES I WANT TO BRING FROM THE DATABASE
        showMarker:true, …
Run Code Online (Sandbox Code Playgroud)

ajax json jqplot

2
推荐指数
1
解决办法
7066
查看次数