The "Hello" example (" H e l") comes from the sourcecode of
my browser.
What's strange is that the two browsers (Netscape 4.03Fr and
IE 5.0) have different source code for the same page.
It do seems that each CHAR that I manage to fetch is coded
with two places (in IE).
I tried the following code for example with the same result
<?php
print "<HTML><HEAD><TITLE>Nice Title, isn't
it</TITLE></HEAD><BODY><PRE>\n";
$conn = OCILogon("XXXXX", "YYYYY", "ZZZBASEZZZ");
$stmt = OCIParse($conn, "select CHAR_COL,
OTHER_DATATYPE_COL from CODE_FICHIER");
OCIExecute($stmt);
// I fetch the five first rows
for ($i = 0; $i < 5; $i++) {
ocifetch($stmt);
$col_1 = ociresult($stmt, "CHAR_COL");
$col_2 = ociresult($stmt, "OTHER_DATATYPE_COL");
echo("\"$col_1\"\t\"$col_2\"\t\n");
}
echo ("</PRE></BODY></HTML>");
?>
The html source is :
<HTML><HEAD><TITLE>le titre</TITLE></HEAD><BODY><PRE>
" " "308"
" A B C" "626"
" " "702"
" A A N" "1108"
" " "1109"
" 7 5 1" "1112"
"" ""
"" ""
</PRE></BODY></HTML>
I will have a look at the HTTP header (Content-Language or
mime-type...), who knows....
Matthias Kopolt a écrit:
>
> use the display sourcecode function of your browser, it is more reliable
> than the output.
>
> try to get the char column with
>
> ocifetch($stmt); $charcol = ociresult($stmt, "nameofcharcol");
>
> maybe your using [] the wrong way so you are getting the chars of the string
> instead of the strings in the row
>
> mk
>
> -----Ursprungliche Nachricht-----
> Von: dsi safir [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 14. Februar 2002 10:23
> An: [EMAIL PROTECTED]
> Betreff: [PHP-DB] php, OCI and datatypes
>
> Hi,
>
> I'm working with Oracle 8.05 and php4.04xx.
> I'm selecting some datas in order to show them in a browser
> (Netscape 4.03Fr or IE5.0).
>
> I found out that my code works well with all datatypes but
> CHAR.
> Varchar2, date or numbers are retrieved and rendered in an
> array without any problems.
> With a char column, I can't see any values with Netscape and
> with IE, I have less than half
> of the string or nothing.
>
> Example : select char_column, other_column from my_table; //
> the query, char_column as a char(5) not null
>
> The output with OCIFetchStatement or OCIFetchInto or else is
> made with something like <TD>$data[$i]</TD>.
> The char column is filled with a blank space on the first
> row.
> On the second row, the char column is filled with a blank
> space between half of the initial string.
> and so on...
> Example : for "Hello" in the table, I get " H e l".(with IE,
> with Netscape I get nothing at all).
>
> So, any ideas ?
>
> Emmanuel Nectoux
>
> --
> 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]
--
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]