Jump to content
php.lv forumi

SkyBreak*

Reģistrētie lietotāji
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Latvia , Jelgava
  • Interests
    Girls and PHP CODING!

Contact Methods

  • Skype
    skybreaklv

SkyBreak*'s Achievements

Newbie

Newbie (1/14)

  1. Parāda tikai Array ( [0] => Albanian_BIN [name] => Albanian_BIN [1] => Albanian, binary sort [description] => Albanian, binary sort ) Izmet tikai kkādu Albian :) neizklausās, ka derētu, mssql db taisīts uz Latvian_CI_AI. Problēmas ir mssql serverī ?
  2. Ar pilku mssql funkciju $query = "SELECT question_id, id, question_right_answer, CAST(question_text AS text) as question_text, CAST(question_answer_1 AS text) as question_answer_1, CAST(question_answer_2 AS text) as question_answer_2, CAST(question_answer_3 AS text) as question_answer_3, CAST(question_answer_4 AS text) as question_answer_4 FROM questions_russian WHERE question_id = 1149"; $result = mssql_query($query); $row = mssql_fetch_array( $result ); print_r($row); Rezultāts: Array ( [0] => 1149 [question_id] => 1149 [1] => 1027.0 [id] => 1027.0 [2] => 2 [question_right_answer] => 2 [3] => ??????????? ?? ??? ???????? ???????? ?????? ??? ??????????? ???????? ?????? ?????????? ????????? ???????? ?? ???????? ??????, ???????????? ?? ???????? [question_text] => ??????????? ?? ??? ???????? ???????? ?????? ??? ??????????? ???????? ?????? ?????????? ????????? ???????? ?? ???????? ??????, ???????????? ?? ???????? [4] => ???????????. [question_answer_1] => ???????????. [5] => ???????????. [question_answer_2] => ???????????. [6] => [question_answer_3] => [7] => [question_answer_4] => ) Pameiģināju kādu no field'iem bez CAST funkcijas, tad parāda to pašu, bet ar erroru. WARNING! Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?'). (severity 16) in EDITED: Pievienoju augšā.. - > ini_set('mssql.charset', 'UTF-8'); [question_right_answer] => 2 [3] => РазрешаетÑÑ Ð»Ð¸ Вам подавать звуковой Ñигнал Ð´Ð»Ñ Ð¿Ñ€Ð¸Ð²Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð²Ð½Ð¸Ð¼Ð°Ð½Ð¸Ñ Ð´Ñ€ÑƒÐ³Ð¸Ñ… учаÑтников дорожного Ð´Ð²Ð¸Ð¶ÐµÐ½Ð¸Ñ Ð·Ð° дорожным знаком, изображенным на риÑунке? [question_text] Ir idejas, kā varētu dabūt ko lasāmāku :) ?
  3. Sveiki, saksāros ar MSSQL vienu problēmu.. Mazliet par sitāciju. Lietoju codeigniter mssql db klasi. Datubāzē field type ir ntext. Pēc parasta SELECT no datubāzes izmetās erros - "Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library" . Pēc tam lasīju internetā, ka vajag ntext tipu uz text datubāzē pārmainīt. Izdarīju tā, bet tad atkal nākamā problēma, jo man datubāzē visi ieraksti ir cyrillic'ā .. Pēc tipa nomainīšanas visi ieraksti palika - ???? . Meklēju talāk risinājumu, atradu funkciju CAST.. Mans querys izskatās šādi: SELECT question_id, id, question_right_answer, CAST(question_text AS text) as question_text, CAST(question_answer_1 AS text) as question_answer_1, CAST(question_answer_2 AS text) as question_answer_2, CAST(question_answer_3 AS text) as question_answer_3, CAST(question_answer_4 AS text) as question_answer_4 FROM [exam].[dbo].[questions_russian] WHERE question_id = 1149 Lai nerastos jautājumi kapēc man tāda datubāze, tapēc, ka codeigniter MSSQL klase mazliet čakarejas, tapēc rakstu pilnu nosaukumu ar visiem escape tagiem.. Izmet erroru - "Must specify table to select from. SELECT *" Biju arī mēģinājis savādāku allias likt - CAST(question_answer_4 AS text) as question_answer_4_alias, bet vienalga, tas pats. Problēma man diezgan steidzama, tapēc ļoti ceru, ka kādam ir kāda ideja, kā to novērst, paldies...
×
×
  • Create New...