Hi,
Been a longtime PB user and have decided to have a bash at converting some of my apps using SB.
I have been looking through the examples and most things are pretty straight forward, but their doesn't seem to be any examples for accessing external databases such as MySQL/MariaDB or Postgres etc.
Has anyone got any pointers or examples on how to implement this with SB ?
Thanks for any help.
Cheers
Noob and database usage.
Re: Noob and database usage.
External database are server side, so not handled by Spiderbasic. You need a script on your server and an API to access it . You can also use a CGI app built with PureBasic.
Re: Noob and database usage.
Thanks for the reply Fred & Happy New Year.Fred wrote:External database are server side, so not handled by Spiderbasic. You need a script on your server and an API to access it . You can also use a CGI app built with PureBasic.
I've never really had much to do with web & CGI mostly i've used PHP which has probably spoilt me .
Can you recomend a API or framework ? or a simple cgi script I can try and get my head around ?
Thanks again.
-
- Posts: 284
- Joined: Fri Sep 22, 2017 7:02 am
Re: Noob and database usage.
If you like to do it with PureBasic, I would recommend Spiderbyte: https://github.com/spiderbytes
Re: Noob and database usage.
That looks intersting - thanks for the heads up Dirk.
Having had a further troll through the SB online help i saw the addition of SQLite. For one of my particular apps ( a document storage system ) this will probably suffice, but are their any problems with multiple users ( not that traffic will be high ).
Again thanks for the help.
Having had a further troll through the SB online help i saw the addition of SQLite. For one of my particular apps ( a document storage system ) this will probably suffice, but are their any problems with multiple users ( not that traffic will be high ).
Again thanks for the help.
Re: Noob and database usage.
I must say that using PHP with PDO has proven to be quite easy and reasonably quick for server-side communication with SpiderBasic. You can even use helper classes like this one to speed up the process.saboteur wrote:Can you recomend a API or framework ? or a simple cgi script I can try and get my head around ?
Everything is done through JSON and data structures available in SpiderBasic, with help of related Insert/ExtractJSON() functions in SpiderBasic. It takes no more than few lines (which are copy/paste; for database initialization through PDO) and queries to communicate. You add json_decode/json_encode() from PHP and you are good to go!