php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27465 using ereg and odbc in a script causes odbc driver error message
Submitted: 2004-03-02 13:31 UTC Modified: 2004-03-02 14:40 UTC
From: gary at koning dot com Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 4.3.4 OS: win2k
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gary at koning dot com
New email:
PHP Version: OS:

 

 [2004-03-02 13:31 UTC] gary at koning dot com
Description:
------------
I am converting an application to win2k/mssql from linux/mysql. Using ereg to validate form field data.
Getting unuasual error message from the win2k odbc driver.


Reproduce code:
---------------
Validation code:

if(  !ereg("^([1-zA-Z0-1@.\s-]{3,18})$",$stmp) )

Using odbc_do(), almost any simple query returning rows
will result in the driver throwing an error message
like:

"Error converting data type varchar to numeric"

I say almost because sometimes a row of data was returned.
But even then, reloading the script would give the above error.

Expected result:
----------------
Valid data from the odbc driver or a known error message.



Actual result:
--------------
Removing the call to ereg() will cause the query to return proper data.

No further info at this time. (Took me 2 days to track this down). I beleive an old copy of active perl is installed on this box, if that has any bearing.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-02 13:35 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.
 [2004-03-02 14:40 UTC] gary at koning dot com
after more testing, ereg() does not seem to be the problem
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC