RE: [PHP-DB] Problems with PHP / Progress / ODBC
| From: | Mark Newnham | Date: | Tue, 08 May 2001 14:48:10 +0000 |
| Subject: | RE: [PHP-DB] Problems with PHP / Progress / ODBC | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9173@lists.php.net to get a copy of this message | ||
Progress databases prefer the odbc_prepare, odbc_execute sequence over the
odbc_exec functions ( I don't know why )
> -----Original Message-----
> From: indrek siitan [mailto:tfr@cafe.ee]
> Sent: Tuesday, May 08, 2001 11:38 AM
> To: php-general@lists.php.net; php-db@lists.php.net
> Subject: [PHP-DB] Problems with PHP / Progress / ODBC
>
>
> Hi,
>
> I'm trying to write a PHP app that accesses a Progress database.
>
> version info:
> - Windows 2000 Pro + Apache 1.3.14
> - PHP 4.0.4pl1 (4.0.5 just wouldn't work on my machine)
> - Progress 8.3.B
> - Merant Progress ODBC drivers v 3.50
>
> the ODBC drivers seem to be fine - I made a MS Access database
> and linked a bunch of Progress tables in there with Get External
> Data / Link tables. I can view/query them just fine.
>
> now, I tried a simple PHP app:
>
> --- 8< ---
>
> <?
> $DBH=odbc_connect("mgauto","","","");
> $sth=odbc_exec($DBH,"SELECT Trkoodi,Trnimi FROM Turyhma");
> while(odbc_fetch_row($sth))
> {
> echo "<li> ".odbc_result($sth,"Trkoodi")." -
> ".odbc_result($sth,"Trnimi");
> }
> odbc_close($DBH);
> ?>
>
> --- 8< ---
>
> The odbc_exec() query seems to be fine (when i do "echo $sth" after
> the exec, i get "Resource id #2"). but the odbc_fetch_row() really
> acts weird - it always returns true so it ends up in endless loop.
> the odbc_result() calls return empty strings.
>
> I've tried the odbc_connect() with all the possible cursor types,
> doesn't help.
>
> I've tried something like that:
>
> --- 8< ---
>
> $i=1;
> while(1)
> {
> if (!odbc_fetch_row($sth,$i)) break;
> echo "<li> ".odbc_result($sth,"Trkoodi")." -
> ".odbc_result($sth,"Trnimi");
> $i++;
> }
>
> --- 8< ---
>
> didn't work either. :(
>
>
> as a really stoopid thing, I tried creating an ODBC source for the
> Access database I created before (with the Progress tables linked
> in via ODBC). now I connected to the Access database via ODBC in
> PHP and tried to query the Progress tables linked into the Access.
> everything worked fine - I could access all the information in
> Progress.
>
>
> any other ideas?
>
>
> Rgds,
> Tfr
>
> --==< tfr@cafe.ee >==< http://tfr.cafe.ee/
> >==< +372-50-17621 >==--
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>