Re: PHP datatype vs Oracle Varchar2
| From: | Thies C. Arntzen | Date: | Thu, 26 Jul 2001 23:10:01 +0000 |
| Subject: | Re: PHP datatype vs Oracle Varchar2 | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-3718@lists.php.net to get a copy of this message | ||
On Thu, Jul 26, 2001 at 05:08:42PM -0500, Victoria Zhou wrote:
>
> Hi,
>
> The comparison between Oracle VARCHAR2 and a PHP string doesn't seems to
> work. Detail as follows:
>
> I have one PHP variable and one Oracle column:
> . $form_user_id: a PHP string obtained from web form input, such as 'user1'.
> . Username: an oracle table column of type VARCHAR2(20).
>
> The following sql statement failed:
> "select * from mytable where Username='$form_user_id'"
>
> It failed because Username has a strlen of 20, where $form_user_id has a
> strlen of 5. If I changed the Username from VARCHAR2(20) to CHAR(20), then
> this sql worked fine. But I think with Oracle VARCHAR2, the strlen of
> Username in this case should be 5 instead of 20.
you must be doing something wrong here;-)
please try to create a _tiny_ testcase (< 20 lines) and post
it to the list, i'm sure you're overseeing something
important.
tc