Page 1 of 1

PHP with dbase

PostPosted: Fri Jul 27, 2018 5:34 am
by Otto
Hello,
has someone compile php with --enable-dbase option.

Best regards
Otto

Re: PHP with dbase

PostPosted: Fri Jul 27, 2018 5:51 am
by Antonio Linares
Dear Otto,

dBase support for php is very limited

Re: PHP with dbase

PostPosted: Mon Jul 30, 2018 1:14 pm
by Marcelo Via Giglio
Hola,

Otto, you can use ADS, and you can use many options to do a serious web interface, PHP, Perl, Python, etc, and the best, SQL with your DBFs

regards

Marcelo

Re: PHP with dbase

PostPosted: Mon Jul 30, 2018 2:22 pm
by Otto
Hello Marcelo,
can you explain how SQL works with dbf?
Thank you in Advance
Otto

Re: PHP with dbase

PostPosted: Mon Jul 30, 2018 3:08 pm
by Silvio.Falconi
I used Sql (Mdb) With Asp many year ago for make a shop on line and it run good
I not found any source good with php and dbf
there is a product of a Brasilian Boy he made a system Fwh+Php+Dbf and run ok . I tried his system of Doctor 'shop on a website and it run ok
But he wanted many USD ....without garances!!! ( without tried his product)

Re: PHP with dbase

PostPosted: Mon Jul 30, 2018 4:34 pm
by Marcelo Via Giglio
Otto,

this is sample posted many years ago

https://app.box.com/s/t2vd0tfrov42usp1kzgucxxs642bmigx

Code: Select all  Expand view
#include "ads.ch"
#include "fivewin.ch"   

REQUEST ADS
REQUEST DBFFPT

function main()
LOCAL oDlg, consulta := SPACE(400), oLbx, path := "                            ",;
      connect, tipo := "ADT"

   RddRegister("ads",1)
   RddSetDefault("Ads")
   AdsSetServerType ( 1 ) // local
   AdsSetFileType(3)

   SET DELETED ON
   adsRightsCheck( .F. )

   DEFINE DIALOG oDlg RESOURCE "consulta"

          REDEFINE GET path ID 102 OF oDlg

      REDEFINE BUTTON ID 103 OF oDlg  ACTION ( AdsDisconnect(AdsConnection()),;
                                               IF ( AdsConnect60( path , 7,"ADSSYS"), ;
                                connect:setcolor(CLR_GREEN, CLR_GREEN),;
                                                    connect:setcolor(CLR_HRED, CLR_HRED ) ;
                              ),;
                                               connect:refresh() ;
                          )
      REDEFINE SAY connect PROMPT "  " ID 110 OF oDlg COLOR CLR_HRED, CLR_HRED
          REDEFINE GET consulta ID 104 OF oDlg
      REDEFINE BUTTON ID 106 OF oDlg ACTION  resultado( consulta )
                               
      REDEFINE BUTTON ID 107 OF oDlg ACTION oDlg:end()

   ACTIVATE DIALOG oDlg

   AdsDisconnect(AdsConnection())

return  nil

FUNCTION resultado( consulta )
    LOCAL oDlg, oLbx,e

   
    ADSCreateSQLStatement("SQLarea",2)
   
    IF ADSExecuteSQLDirect( consulta )
       TRY
         
         DEFINE DIALOG oDlg RESOURCE "resultado"

      REDEFINE LISTBOX oLbx FIELDS ALIAS "SQLarea" ID 101 OF oDlg
          REDEFINE SAY PROMPT "RESULTADO : " + ALLTRIM( STR ( SQLarea -> ( LASTREC() ) ) )  ID 200 OF oDlg COLOR CLR_BLUE
      REDEFINE BUTTON ID 102 OF oDlg ACTION oDlg:end()
      REDEFINE BUTTON ID 103 OF oDlg ACTION oLbx:report()

         ACTIVATE DIALOG oDlg
     sqlarea -> ( DBCLOSEAREA() )

       CATCH e
         ? "COMANDO EJECUTADO"
       END
    ELSE
        MSGINFO("Error en la ejecución de la consulta")
    sqlarea -> ( DBCLOSEAREA() )
    ENDIF
       
RETURN NIL
 


to download the sample

https://app.box.com/s/r0w5vgxzugucoavqjzpba9he6625gvgu

To test

1.- put in Local Path .
2.- press conectar
3.- put SQL sentence ej. select * from customer order by first
4.- Ejecutar

Regards

Marcelo

Re: PHP with dbase

PostPosted: Wed Aug 08, 2018 6:59 pm
by Carlos Mora
Hi Marcelo
Marcelo Via Giglio wrote:Otto, you can use ADS, and you can use many options to do a serious web interface, PHP, Perl, Python, etc, and the best, SQL with your DBFs

AFAIK, Advantage for PHP is an old version supporting PHP 5, not sure if it can work with 2.0 or 7.2, am I wrong?
I wasn't be able to find a reference to a new versions since 2015, that in PHP timeline is a _lot_.
IMHO if that's the case, probably it isn't worth it to invest in that solution.

KR

Re: PHP with dbase

PostPosted: Thu Aug 09, 2018 7:24 pm
by reinaldocrespo
Hello Carlos/Everyone;

Advantage has focused more on oData and Json with Advantage web api service they introduced with version 11. So you can use any web development platform and still be able to access .dbf data all the same via Json or oData. Having said that, Advantage does have a PHP extension for Linux and windows so you can use pure PHP to connect and access your data any time.

Here is a link that shows how to access dbf/cdx data under Advantage using open protocol oData:
http://jdmullin.blogspot.com/2010/09/advantage-web-api.html

Keep in mind Advantage is fully ISAM as well as SQL. Most web development languages are only SQL. What I'm trying to say is that you will probably have to learn some SQL in order to access your dbfs/cdxs across the web using PHP with Advantage but that limitation is imposed by the web developing language and not Advantage. Advantage speaks both just the same. With time, you realize SQL is better structured to access remote data, but I digress.

Here is a link to a complete non-oData PHP system accessing Advantage data (dbfs/cdxs) :
http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?devguide_accessing_advantage_using_the_advantage_php_extension.htm

I have a couple PHP portals accessing Advantage data across the internet where the web server is in one continent and the Advantage data (ADTs and DBFs) server is on another. It works great. The beauty is you can have FW-Win32 apps writing/reading/ reporting on the same data you also have PHP web portals doing the same on the same data. Likewise, the remote client doesn't have to be a browser, it could be an Android tablet pulling oData via the Advantage Web API.

I know all this sounds confusing. If paying for the server software is an option, then I would explore Advantage one step at a time. Eventually it all makes sense. Keep in mind that Advantage has free 2 user licenses of the server where you can write and test.

Hope that helps,



Reinaldo.

Re: PHP with dbase

PostPosted: Fri Aug 10, 2018 12:25 am
by Lailton
Otto,

You can to use Harbour + DBFCDX without needed extern application with CGI.

Contact me on skype and I can show you the power Harbour for Web!

I have a full application using a lot of DBFCDX working perfect with my FiveWeb!

Re: PHP with dbase

PostPosted: Fri Aug 10, 2018 1:11 am
by reinaldocrespo
Lailton wrote:Otto,

You can to use Harbour + DBFCDX without needed extern application with CGI.

Contact me on skype and I can show you the power Harbour for Web!

I have a full application using a lot of DBFCDX working perfect with my FiveWeb!


But you have to host the web server on your own server manage it and be responsible for everything including security. I don't think hosted servers will allow you to execute any code on their server. Correct?

Reinaldo.

Re: PHP with dbase

PostPosted: Fri Aug 10, 2018 1:39 am
by fraxzi
reinaldocrespo wrote:Hello Carlos/Everyone;

Advantage has focused more on oData and Json with Advantage web api service they introduced with version 11. So you can use any web development platform and still be able to access .dbf data all the same via Json or oData. Having said that, Advantage does have a PHP extension for Linux and windows so you can use pure PHP to connect and access your data any time.

Here is a link that shows how to access dbf/cdx data under Advantage using open protocol oData:
http://jdmullin.blogspot.com/2010/09/advantage-web-api.html

Keep in mind Advantage is fully ISAM as well as SQL. Most web development languages are only SQL. What I'm trying to say is that you will probably have to learn some SQL in order to access your dbfs/cdxs across the web using PHP with Advantage but that limitation is imposed by the web developing language and not Advantage. Advantage speaks both just the same. With time, you realize SQL is better structured to access remote data, but I digress.

Here is a link to a complete non-oData PHP system accessing Advantage data (dbfs/cdxs) :
http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?devguide_accessing_advantage_using_the_advantage_php_extension.htm

I have a couple PHP portals accessing Advantage data across the internet where the web server is in one continent and the Advantage data (ADTs and DBFs) server is on another. It works great. The beauty is you can have FW-Win32 apps writing/reading/ reporting on the same data you also have PHP web portals doing the same on the same data. Likewise, the remote client doesn't have to be a browser, it could be an Android tablet pulling oData via the Advantage Web API.

I know all this sounds confusing. If paying for the server software is an option, then I would explore Advantage one step at a time. Eventually it all makes sense. Keep in mind that Advantage has free 2 user licenses of the server where you can write and test.

Hope that helps,



Reinaldo.


Great Source! :wink: :wink: :wink:

Thanks for these..