PHP-ODBC-MSSQL (Text type fields) PART II

From: Date: Tue, 10 Jul 2001 21:56:31 +0000
Subject: PHP-ODBC-MSSQL (Text type fields) PART II
Groups: php.db 
Request: Send a blank email to php-db+get-10234@lists.php.net to get a copy of this message
Hi I found an interesting thing.. But it will just make my work much harder.. comparing to ASP... :o(((( (which I already am not able to use in the project we should deliver to our customer in a few weeks.... :o(((( <?php // database settings $dsn = "dsn_database"; $user = "enduser"; $pass = ""; $query = "EXEC usp_get_subj 10"; /* $query = "SELECT col_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(256) FROM tbl_subject WHERE col_subj_id = 10"; */ $conn = odbc_connect($dsn, $user, $pass); $res = odbc_exec($conn, $query); $data = odbc_result($res, "col_subj_content"); $data = odbc_result($res, 8); echo $data; odbc_close($conn); ?> This code will not retrieve the data from col_subj_content.. But!! If I replace the call of the stored procedure by the same its content but as an obviouse SQL query, everything will work and I will get the content of this field.. Hmm... So, what is the hell is that??? Could anyone HELP me to use the calls of sp way in the right way?!? <?php // database settings $dsn = "dsn_database"; $user = "enduser"; $pass = ""; $query = "SELECT col_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(2560 FROM tbl_subject WHERE col_subj_id = 10"; $conn = odbc_connect($dsn, $user, $pass); $res = odbc_exec($conn, $query); $data = odbc_result($res, "col_subj_content"); $data = odbc_result($res, 8); echo $data; odbc_close($conn); ?> The stored procedure is: Create Procedure usp_get_subj ( @subj_id int ) As SELECT col_subj_id, col_cat_id, col_lang_id, col_subj_class, col_subj_owner_id, col_subj_secur, col_subj_last_update, col_subj_title, --varchar(512) col_subj_reg_page, --varchar(128) col_subj_content, -- text(16) col_subj_keywords --varchar(2560 FROM tbl_subject WHERE col_subj_id = @subj_id RETURN Michael Yevdokimov Web developer e-mail: michaely@globalocity.com -------------------------------- Globalocity B.V. Tel.: +31 (0)70 312 2814 Fax.: +31 (0)70 312 2808 http://www.globalocity.com e-mail: info@globalocity.com --------------------------------

« previous php.db (#10234) next »