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 
MDB2_Driver_mysql Problems

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration
View previous topic :: View next topic  
Author Message
freethinker33



Joined: 06 Jun 2008
Posts: 3
Location: California / Iowa

PostPosted: Fri Jun 06, 2008 4:50 am    Post subject: MDB2_Driver_mysql Problems Reply with quote

Hey everyone, thanks in advance for any help. Really excited to get Pear going and thought I was making good headway until this!

Problem: I already ran "pear install MDB2_Driver_mysql-beta" and I get this:

MDB2 Error: not found :: unable to find package 'MDB2_Driver_mysql' file 'MDB2/Driver/mysql.php'

Fatal error: Call to undefined method MDB2_Error::query() in /Library/WebServer/Documents/sc/dblib.php on line 15

Below is dblib.php

Code:

<?php
require_once( "MDB2.php" );
$dsn = 'mysql://root:some-password@localhost/sc';
$mdb2 =& MDB2::factory( $dsn, array() );

if (PEAR::isError($mdb2)) {
   echo $mdb2->getMessage(). ' :: '. $mdb2->getUserInfo();
}

function get_db() { global $mdb2; return $mdb2; }

function get_products( )
{
  global $mdb2;
  $res = $mdb2->query( "SELECT * FROM product", array( ) );
  $out = array();
  if ( $res != null )
    while( $res->fetchInto( $row, MDB2_FETCHMODE_ASSOC ) ) { $out []= $row; }
  return $out;
}

function product_info( $id )
{
  global $mdb2;

  $res = $mdb2->query( "SELECT * FROM product WHERE id=?",
    array( $id ) );

  if ( $res != null )
  {
    $res->fetchInto( $row, MDB2_FETCHMODE_ASSOC );
    return $row;
  }
  return null;
}
?>



I think it's just telling me one of my configs is wrong - it can't find it so I must have pointed something wrong. When I run tests Pear runs correctly. However when I look at all my configs it states that php.ini is undefined... is that the problem and if so how can I fix that?
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Fri Jun 06, 2008 1:58 pm    Post subject: Reply with quote

Did you update your include_path? It needs to include the directory in which PEAR.php (and MDB2.php) reside.
Back to top
View user's profile Send private message
freethinker33



Joined: 06 Jun 2008
Posts: 3
Location: California / Iowa

PostPosted: Fri Jun 06, 2008 9:59 pm    Post subject: Yes Reply with quote

Hey Mark, thanks for your response. Yes I did change the path to my includes correctly in both my php.ini and php.ini.default (even though I know I only needed to do the first, I'm just being double sure)

I can run several tests to get PEAR to echo things and validate that it is in fact alive and well -- only trouble here is that it's unable to find my package: unable to find package 'MDB2_Driver_mysql' file 'MDB2/Driver/mysql.php'

Know how I can get it to find those files? :-S

Thank you! Smile
Back to top
View user's profile Send private message
freethinker33



Joined: 06 Jun 2008
Posts: 3
Location: California / Iowa

PostPosted: Fri Jun 06, 2008 11:32 pm    Post subject: One more thing Reply with quote

I can install a wordpress, or any database and write old school queries and get results.

This is making me think there just may be something wrong in my code.

Time to make another pot of coffee
Shocked
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Sat Jun 07, 2008 12:02 pm    Post subject: Reply with quote

Ah, the file is actually missing? You didn't read the installation instructions then.

pear install MDB2_Driver_mysql
or
pear install MDB2#mysql
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration 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

'Actiemonitor' online projectmanagement software