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: [EMAIL PROTECTED]
--------------------------------
Globalocity B.V.
Tel.: +31 (0)70 312 2814
Fax.: +31 (0)70 312 2808
http://www.globalocity.com
e-mail: [EMAIL PROTECTED]
--------------------------------
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]