database - Sum Column with Oracle 11 and PHP - what's wrong? ← (PHP)

Solution:

If EDTA_DATA is date (datatype), don't compare it to a string as '19.10.01' is a string. Oracle will implicitly try to convert it to appropriate date, but that doesn't have to work always. Besides 19.10.01 can be anything (2019 Oct 01, or 19 Oct 2001, or ...), depends on NLS settings.

Take control over it; see whether using date literal helps (it always has yyyy-mm-dd format):

where edta_data = date '2019-10-01'

Furthermore, if edta_data contains time component (hours, minutes, seconds), then the simplest option is to truncate it, e.g.

where trunc(edta_data) = date '2019-10-01'

but it'll prevent Oracle from using index on that column (if it exists). It can be fixed, no problem; but - first see whether anything of above helps.

Answer



Solution:

You have to use Upper Case as defined here:

column_name The column name used in the query.

Use uppercase for Oracle's default, non-case sensitive column names. Use the exact column name case for case-sensitive column names.

from: https://www.php.net/manual/en/function.oci-define-by-name.php

Then: oci_define_by_name($sumParse, "NOSHOWS", $total);

Source