Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PEAR DB.php łączenie z bazą mssql
qoonieczko
post
Post #1





Grupa: Zarejestrowani
Postów: 27
Pomógł: 0
Dołączył: 30.07.2013

Ostrzeżenie: (0%)
-----


Witam,

Mam zainstalowanego xamppa na windowsie7. Zainstalowałem sobie DP.php
(http://pear.php.net/package/DB/download)

Mam taki kod:
  1. <?php
  2. require_once 'DB.php';
  3. function polacz() {
  4. $dsn = 'mssql://login:haslo@serwer/baza';
  5.  
  6. $options = array ('debug' => 5, 'portability' => DB_PORTABILITY_ALL, 'persistent' => true);
  7. $db = & DB :: connect($dsn, $options);
  8.  
  9.  
  10. if (PEAR :: isError($db)) {
  11. echo 'Standard Message: '.$db->getMessage()."<br>";
  12. echo 'Standard Code: '.$db->getCode()."<br>";
  13. echo 'DBMS/User Message: '.$db->getUserInfo()."<br>";
  14. echo 'DBMS/Debug Message: '.$db->getDebugInfo()."<br>";
  15. }
  16.  
  17.  
  18. return $db;
  19. }
  20.  
  21.  
  22. $db = polacz();
  23.  
  24. $sql = "SELECT * FROM wusr_IT_HR_map with (nolock) where location LIKE '4%%' and res_id>0 and mainloc='007'";
  25.  
  26. $res = & $db->query($sql);
  27.  
  28. if (PEAR :: isError($res)) {
  29. /* echo 'Standard Message: '.$res->getMessage()."<br>";
  30. echo 'Standard Code: '.$res->getCode()."<br>";
  31. echo 'DBMS/User Message: '.$res->getUserInfo()."<br>";
  32. echo 'DBMS/Debug Message: '.$res->getDebugInfo()."<br>";*/
  33. }
  34. ?>


Dostaje komunikat:

Standard Message: DB Error: extension not found
Standard Code: -25
DBMS/User Message: [DB Error: extension not found] ** mssql://login:haslo@serwer/baza
DBMS/Debug Message: [DB Error: extension not found] ** mssql://login:haslo@serwer/baza

Ma ktoś pomysł co jeszcze powinienem zrobić, zainstalować? Dodam, że mam serwer na linuxie i wszystko działa. Niestety nie ja go konfigurowałem. Będę wdzięczny za wskazówki/rozwiązania.

Pozdrawiam!
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 22:31