PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Unknown DataSource driver

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures
View previous topic :: View next topic  
Author Message
telepro



Joined: 16 Mar 2009
Posts: 2

PostPosted: Mon Mar 16, 2009 1:40 pm    Post subject: Unknown DataSource driver Reply with quote

hello all,

I just tested a mdb2 example and everything was right,

now I am following a another simple example using mdb2 combined with datagrid but it fails in datagrid->bind method raising the message “Unknown DataSource driver. Please specify an existing driver” which lead me to think that datagrid not know what data driver I intent to use or it is not where it is supposed to be,
Code:
<?php
require_once 'DataGrid/DataGrid.php';

// Instantiate the DataGrid
$datagrid =& new Structures_DataGrid();
// Print error if any
if (PEAR::isError($test)) {
    echo "Structures_DataGrid ";
    echo $datagrid ->getMessage();
    exit();
}

// Bind a basic SQL statement as datasource
$options = array('dsn' => 'mysql://username:password@hosturl/databasename');
$test = $datagrid->bind('SELECT id, cc, descripcion FROM tbl_pgc_espanol LIMIT 10', $options);

// Print binding error if any
if (PEAR::isError($test)) {
    echo "binding ";
    die($test->getMessage());
}

// Print the DataGrid with the default renderer (HTML Table)
$test = $datagrid->render();

// Print rendering error if any
if (PEAR::isError($test)) {
    echo "rendering ";
    die($test->getMessage());
}

?>

please take note that I am not installing pear on server I am just copying php folders and files into my web space directory, it is the only way i know to run pear in that server,

how datagrid knows where to find datasource binding code?,

thank you in advance.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1230

PostPosted: Mon Mar 16, 2009 2:42 pm    Post subject: Reply with quote

Your require_once call indicates that your directories are not correct. DataGrid.php should be in a directory named "Structures", not in "DataGrid".
Back to top
View user's profile Send private message
telepro



Joined: 16 Mar 2009
Posts: 2

PostPosted: Tue Mar 17, 2009 3:08 am    Post subject: Reply with quote

mark wrote:
Your require_once call indicates that your directories are not correct. DataGrid.php should be in a directory named "Structures", not in "DataGrid".


thank you for your suggestion mark but i changed the folder name and require_once references accordingly but the error remains,

for more details below i copy the pear folders i copied in the web space folder in order to someone could detect some misleading folder or file into (if any),

thanks in advance,

MDB2/
MDB2/Driver
MDB2/Driver/Datatype
MDB2/Driver/Datatype/mysql.php
MDB2/Driver/Function
MDB2/Driver/Function/mysql.php
MDB2/Driver/Manager
MDB2/Driver/Manager/mysql.php
MDB2/Driver/mysql.php
MDB2/Driver/Native
MDB2/Driver/Native/mysql.php
MDB2/Driver/Reverse
MDB2/Driver/Reverse/mysql.php
MDB2/MDB2.php
MDB2/mysql.php
Pager/
Pager/Common.php
Pager/HtmlWidgets.php
Pager/Jumping.php
Pager/Pager.php
Pager/Pager_savebc.php
Pager/Sliding.php
PEAR/
PEAR/Autoloader.php
PEAR/Builder.php
PEAR/ChannelFile
PEAR/ChannelFile.php
PEAR/ChannelFile/Parser.php
PEAR/Command
PEAR/Command.php
PEAR/Command/Auth.php
PEAR/Command/Build.php
PEAR/Command/Channels.php
PEAR/Command/Common.php
PEAR/Command/Config.php
PEAR/Command/Install.php
PEAR/Command/Mirror.php
PEAR/Command/Package.php
PEAR/Command/Pickle.php
PEAR/Command/Registry.php
PEAR/Command/Remote.php
PEAR/Command/Test.php
PEAR/Common.php
PEAR/Config.php
PEAR/Dependency.php
PEAR/Dependency2.php
PEAR/DependencyDB.php
PEAR/Downloader
PEAR/Downloader.php
PEAR/Downloader/Package.php
PEAR/ErrorStack.php
PEAR/Exception.php
PEAR/FixPHP5PEARWarnings.php
PEAR/Frontend
PEAR/Frontend.php
PEAR/Frontend/CLI.php
PEAR/Installer
PEAR/Installer.php
PEAR/Installer/Role
PEAR/Installer/Role.php
PEAR/Installer/Role/Cfg.php
PEAR/Installer/Role/Common.php
PEAR/Installer/Role/Data.php
PEAR/Installer/Role/Doc.php
PEAR/Installer/Role/Ext.php
PEAR/Installer/Role/Php.php
PEAR/Installer/Role/Script.php
PEAR/Installer/Role/Src.php
PEAR/Installer/Role/Test.php
PEAR/Installer/Role/Www.php
PEAR/PackageFile
PEAR/PackageFile.php
PEAR/PackageFile/Generator
PEAR/PackageFile/Generator/v1.php
PEAR/PackageFile/Generator/v2.php
PEAR/PackageFile/Parser
PEAR/PackageFile/Parser/v1.php
PEAR/PackageFile/Parser/v2.php
PEAR/PackageFile/v1.php
PEAR/PackageFile/v2
PEAR/PackageFile/v2.php
PEAR/PackageFile/v2/rw.php
PEAR/PackageFile/v2/Validator.php
PEAR/Packager.php
PEAR/Registry.php
PEAR/Remote.php
PEAR/REST
PEAR/REST.php
PEAR/REST/10.php
PEAR/REST/11.php
PEAR/REST/13.php
PEAR/RunTest.php
PEAR/Task
PEAR/Task/Common.php
PEAR/Task/Postinstallscript
PEAR/Task/Postinstallscript.php
PEAR/Task/Postinstallscript/rw.php
PEAR/Task/Replace
PEAR/Task/Replace.php
PEAR/Task/Replace/rw.php
PEAR/Task/Unixeol
PEAR/Task/Unixeol.php
PEAR/Task/Unixeol/rw.php
PEAR/Task/Windowseol
PEAR/Task/Windowseol.php
PEAR/Task/Windowseol/rw.php
PEAR/Validate.php
PEAR/Validator
PEAR/Validator/PECL.php
PEAR/XMLParser.php
Structures/
Structures/DataGrid
Structures/DataGrid.php
Structures/DataGrid/Column.php
Structures/DataGrid/DataSource.php
Structures/DataGrid/Renderer.php
Structures/DataSource
Structures/DataSource/MDB2.php
Structures/Renderer
Structures/Renderer/HTMLTable.php
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1230

PostPosted: Tue Mar 17, 2009 9:30 am    Post subject: Reply with quote

Please don't try to be smarter than the PEAR installer is. Wink It's always a good idea to use it, at least for the initial local installation. (Just copying the files to the webserver from the local harddisk is fine in most cases.)

Code:

Structures/DataSource
Structures/DataSource/MDB2.php

need to be
Code:

Structures/DataGrid/DataSource
Structures/DataGrid/DataSource/MDB2.php


The same holds for the Renderer directory.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement