Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MSSQL][PHP] Problem z zapytaniem
kpt_lucek
post 24.07.2012, 22:14:20
Post #1





Grupa: Zarejestrowani
Postów: 428
Pomógł: 77
Dołączył: 10.07.2011
Skąd: Warszawa

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


Witajcie!

Zwracam się z pewnym problemem, otóż od kilkunastu godzin zmagam się z problemem wysłania żądania do MSSql'a, mianowicie skrypt zamieszczony poniżej (a właściwie ta metoda) ma za zadanie wysłać żądanie/polecenie uruchamiające job'a w MSSQL.

  1. private function send_request()
  2. {
  3. $this->job = 'EXPORT';
  4. $w = mssql_query("SELECT top 1 (...) ORDER BY BUFOR_ID DESC"); // nie ma w tym zapytaniu podstawiania zmiennych więc obciąłem...
  5. $this->rows = mssql_num_rows($w);
  6. if(mssql_num_rows($w) > 0)
  7. {
  8. $ch = "USE MSDB EXEC sp_help_job @job_name = '".$this->job."'";
  9. $kk2 = mssql_query($ch);
  10. $kkkk2 = mssql_fetch_array($kk2);
  11. $g = mssql_fetch_array($w);
  12. $this->bufor = $g['BUFOR_ID'];
  13. return $kkkk2['current_execution_status'];
  14. }
  15.  
  16. }


Względnie wszystko działa (job niby startuje... efekt końcowy w postaci dumpa bazy jest) ale sam skrypt zwraca błąd w postaci:
Kod
Warning: upClass::send_request(): message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in /var/www/szukaj/_php_files/upClass.php on line 0 Warning: upClass::send_request(): General SQL Server error: Check messages from the SQL Server (severity 16) in /var/www/szukaj/_php_files/upClass.php on line 0


Ten post edytował kpt_lucek 24.07.2012, 22:14:58


--------------------


Cytat
There is a Bundle for that
Lukas Kahwe Smith - October 31th, 2014
Go to the top of the page
+Quote Post
Yaresen
post 24.07.2012, 22:49:08
Post #2





Grupa: Zarejestrowani
Postów: 11
Pomógł: 2
Dołączył: 24.07.2012
Skąd: Lubin

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


Musisz wprowadzić małe zmiany:

Plik: /etc/freetds/freetds.conf
Kod
[global]
;tds version = 4.2
tds version = 8.0
client charset = UTF-8


Plik: php.ini
Kod
mssql.charset = "UTF-8"
Go to the top of the page
+Quote Post
kpt_lucek
post 24.07.2012, 23:04:56
Post #3





Grupa: Zarejestrowani
Postów: 428
Pomógł: 77
Dołączył: 10.07.2011
Skąd: Warszawa

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


Dzięki


--------------------


Cytat
There is a Bundle for that
Lukas Kahwe Smith - October 31th, 2014
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 8.07.2025 - 20:43