Re: Bug #1463: Error 'Document contains no data.' occurs.
| From: | Thies C. Arntzen | Date: | Fri, 28 May 1999 09:58:53 +0000 |
| Subject: | Re: Bug #1463: Error 'Document contains no data.' occurs. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-6128@lists.php.net to get a copy of this message | ||
On 28 May 1999 smweb@ihost.de wrote:
> From: smweb@ihost.de
> Operating system: Linux
> PHP version: 3.0.7
> PHP Bug Type: Oracle related
> Bug description: Error 'Document contains no data.' occurs.
>
> Hi,
>
> thanks! PHP is really great, but I found a bug concerning Oracle 8:
>
> When I go with this statement, everything works perfectly:
>
> $stmt = OCIParse($conn, "SELECT b.bestnr, TO_CHAR(b.erstdatum, 'dd.mm.yyyy')
> xdatum, TO_CHAR(b.erstdatum, 'hh:mi') xzeit, b.vorname, b.nachname, b.strasse, b.plz,
> b.ort, b.telefon, b.email, b.porto, b.zahlung, b.bezahlt, b.alterx, b.beruf, b.woher, b.ipadresse,
> SUM(p.preis) xpostsum, count(p.postnr) xpostcount FROM eshirt_bestellung b, eshirt_posten p WHERE
> b.bestnr = p.bestnr AND b.bezahlt = 1 GROUP BY b.bestnr, b.erstdatum, b.vorname, b.nachname,
> b.strasse, b.plz, b.ort, b.telefon, b.email, b.porto, b.zahlung, b.bezahlt, b.alterx, b.beruf,
> b.woher, b.ipadresse ORDER BY b.bestnr");
>
> When I change 'b.bezahlt = 1' (in the WHERE part) to 'bezahlt = 0', I get a
> message from the browser 'Document contains no data'. When I execute the exactly same
> statement in sqlplus, there's no probelem at all. Also, when I change it to 'bezahlt =
> 2', it works. Just 'bezahlt = 0' doesn't work.
>
> bezahlt is a number value.
this should be fixed in 3.0.8 - please download it and try. please send me
your results!
regsrads,
tc
BTW:
you don't need to use ocidefinebyname as ocifetchinto($stmt,OCI_ASSOC)
will return a nice associative array (containing all the values) to you!
>
> If you need my further code, here it is:
>
> OCIDefineByName($stmt,"BESTNR", &$bestnr);
> OCIDefineByName($stmt,"XDATUM", &$xdatum);
> OCIDefineByName($stmt,"XZEIT", &$xzeit);
> OCIDefineByName($stmt,"VORNAME", &$vorname);
> OCIDefineByName($stmt,"NACHNAME", &$nachname);
> OCIDefineByName($stmt,"STRASSE", &$strasse);
> OCIDefineByName($stmt,"PLZ", &$plz);
> OCIDefineByName($stmt,"ORT", &$ort);
> OCIDefineByName($stmt,"TELEFON", &$telefon);
> OCIDefineByName($stmt,"EMAIL", &$email);
> OCIDefineByName($stmt,"PORTO", &$porto);
> OCIDefineByName($stmt,"ZAHLUNG", &$zahlung);
> OCIDefineByName($stmt,"BEZAHLT", &$bezahlt);
> OCIDefineByName($stmt,"ALTERX", &$alterx);
> OCIDefineByName($stmt,"BERUF", &$beruf);
> OCIDefineByName($stmt,"WOHER", &$woher);
> OCIDefineByName($stmt,"XPOSTCOUNT", &$xpostcount);
> OCIDefineByName($stmt,"XPOSTSUM", &$xpostsum);
> OCIDefineByName($stmt,"IPADRESSE", &$ipadresse);
> OCIExecute($stmt);
>
> $myLines = 0;
> while (OCIFetch($stmt)) {
> $myLines++;
> $gesamt = $porto + $xpostsum;
> [... echo stuff ...]
> }
> }
>
> OCIFreeStatement($stmt);
> OCILogOff($conn);
>
> Would be very nice if you would correct this in the next version, since I really like using PHP
> and Oracle.
>
> Thanks,
> - Steffen
>
>
> --
> PHP Development Mailing List http://www.php.net/
> To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
> For help: php-dev-help@lists.php.net
>
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net