PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old March 29th, 2007, 06:02 PM
ealucas ealucas is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ealucas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ODBC "DB Error: not supported"

I'm trying to move a web application from the development environment (Linux/Apache/MySQL) to the production environment (Windows2000/IIS/ODBC[SqlServer]) and I'm encountering the following error when I try a query:

"DB Error: not supported"

I'm using PEAR:B and PHP 4.3.3
We just installed the PEAR libraries using go_pear.bat and it seemed to install just fine.

Here is the code... it is a login script that
either authenticates the user or sends them back
to the index.php page to try again:

php Code:
Original - php Code
  1.  
  2. <?php
  3. require_once( "DB.php" );
  4. require_once( "dconfig.php" ) ;
  5. $db =& DB::Connect( $dsn ) ; // , array() );
  6. print "<html><head>testpage</head><body><pre>n" ;
  7. if (PEAR::isError($db)) {
  8. //    header("Location: index.php?e=01") ;
  9.     $str = "Location: index.php?e=01&" . $db->getMessage()  ;
  10.     header("Location: index.php?e=01&" . urlencode($db->getMessage()) ) ;
  11.     exit ;
  12. } else {
  13.     $db->setFetchMode(DB_FETCHMODE_ASSOC) ;
  14.     if ( isset($_POST['useremail']) and isset($_POST['userpass']) ) {
  15.         $SQL = " SELECT id, isadmin FROM users WHERE email = ? and password_string = ? " ;
  16.         $STMT = $db->prepare( $SQL ) ;
  17.         $res =& $db->execute( $STMT, array($_POST['useremail'],$_POST['userpass']) ) ;
  18.         if (PEAR::isError($res)) {
  19.             // query failed
  20.             header("Location: index.php?e=02") ;
  21.             exit;
  22.         }else{   
  23.             if ( $res->numRows() == 1 ) {
  24.                 if ( $res->fetchinto($row) ) {
  25.                     session_start() ;
  26.                     $_SESSION['userid'] = $row['id'] ;
  27.                     $_SESSION['isadmin'] = $row['isadmin'] ;
  28.                     // Authenticated user.... proceed
  29.                     header("Location: welcome.php") ;
  30.                     exit ;
  31.                 }else{
  32.                     // unable to process the row of data (?!)
  33.                     header("Location: index.php?e=03") ;
  34.                     exit;
  35.                 }
  36.             }elseif ( $res->numRows() > 1 ) {
  37.                 // multiple records - needs admin to fix
  38.                 print "num rows: " . print_r($res->numRows()) . "n" ;
  39.                 // header("Location: index.php?e=04" ) ;
  40.                 exit;
  41.             }else{
  42.                 // no record - bad login
  43.                 header("Location: index.php?e=00") ;
  44.                 exit;
  45.             }
  46.         }
  47.     }else{
  48.     // attempt to directly execute login.php (missing POST vars)
  49.         header("Location: index.php") ;
  50.         exit;
  51.     }
  52. }
  53. print "</pre></body></html>" ;
  54. ?>
  55.  
  56.  
  57.  





Reply With Quote
  #2  
Old March 29th, 2007, 06:03 PM
ealucas ealucas is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ealucas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: ODBC "DB Error: not supported"

Hummmm, so "save" is not the same as "preview" :-)
Anyway, any help is appreciated - I'm at a loss.

Tnx
Eric

Reply With Quote
  #3  
Old March 29th, 2007, 06:24 PM
ealucas ealucas is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 ealucas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: ODBC "DB Error: not supported"

Reviewing the notes I've made I realize this may be helpful. The error occurs when I execute the $res->numRows() method. Tracing it back to the DB.php file is of no help... it's just the function that handles the error but no clue as to what caused it. Also, $res is a db_error object but for some reason the PEAR::isError($res) test does not detect it... it waits until the numRows() > 1 test so I end up at the
header("index.php?e=04" line in my code instead of the "?e=02" line.

Thanks
Eric

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > ODBC "DB Error: not supported"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek