Page 1 of 1
Question about a simple user databse
Posted: Wed May 22, 2013 1:07 am
by treefolk
So, I am designing an app in livecode that allows online poker players to keep notes on each other. One of the features I am trying to include is a "public notes" option.
Basically I need 2 columns one for player name, and one for the comments that have been left. the app needs to be able to retrieve and edit the data. Would it be possible to use a google drive spreadsheet for this? I had tried to use an ftp server and .txt files as a simple way to do this, but it seems that would not work with many users trying to add comments simultaneously . I would appreciate any help or hints you guys might have.
Thanks in Advance,
Treefolk
Re: Question about a simple user databse
Posted: Wed May 22, 2013 6:17 am
by dave_probertGA6e24
Hi Treefolk,
I can't answer the part about using Google Spreadsheets, but I can recommend using a server-side database such as MySQL or even SQLite - with a PHP, ASP or whatever server-side language you are happy with, wrapper.
There are many, many examples of PHP scripts to access MySQL/SQLite Databases and you don't need to have a fancy Web front-end to go with it. A basic request receiver page that handles the incoming URL request and prints out the results should be adequate. In LC you then simply make a piece of code similar to this:
Code: Select all
put URL ("http://yourwebserver.com/yourfilename.php?dothis=getdata&user=1234") into myres
split myres by return and tab
put myres[1][2] into field "whatever"
put myres[1][3] into field "otherstuff"
doing it this way means that you have a flexible database backend which you can enhance to suit whatever your program wants to do in the future. But even more so you have a framework process to allow other apps to use your remote databases.
Learning the PHP or whatever server-side language is not that difficult really when you focus on only that aspect you really need (you don't need to worry about fancy HTML stuff).
If you want more detail then let me know - I'm sure I can point you towards some good PHP tutorials or even knock together an example script (Hmm, maybe I should do a tutorial myself on the subject!).
PS. Forgot to mention that this would allow many, many people to add/view/edit at the same time.
Cheers,
Dave
Re: Question about a simple user databse
Posted: Wed May 22, 2013 6:47 am
by Simon
Hi Dave,
Hmm, maybe I should do a tutorial myself on the subject!
I'd read it!!! N' stuff.
Simon
Re: Question about a simple user databse
Posted: Wed May 22, 2013 2:09 pm
by dave_probertGA6e24
Ok, Simon, you persuaded me
I've started work on it - it'll be ready in a couple of days.
Cheers,
Dave
Re: Question about a simple user databse
Posted: Sun May 26, 2013 10:27 pm
by treefolk
Thank you for the replies! I should point out that I consider myself a hobbyist at best, so any tutorial you could link to would be great. I have checked out a few web services such as microsoft azure and caspio bridge, but I am pretty lost, I do not know anything about php, or sql in general for that matter, so forgive me if what I am asking is very simple. Would it be possible to have a stack hosted online that users could open end edit simultaneously?
Re: Question about a simple user databse
Posted: Sun May 26, 2013 10:41 pm
by Simon
Goooo Dave!
Simon
Re: Question about a simple user databse
Posted: Mon May 27, 2013 7:08 pm
by dave_probertGA6e24
Hi,
Took me a couple of days longer than I expected and might not be quite correct yet, but here is my first Tutorial for Livecode.
Livecode and Remote Database access via Server-Side Scripting (for beginners!)
It can be found here:
http://www.vampire-tiger.info/livecode- ... bases.html
and if you see any problems or don't follow something I've put there, then please let me know either here or via email (at the top of the tutorial page).
Apologies in advance for the layout and colour coding - but it seems that some things go a little weird in CSS. I'll take another look at that in a couple of days.
Cheers for now,
Dave
Re: Question about a simple user databse
Posted: Mon May 27, 2013 7:35 pm
by Klaus
Hi Dave,
wonderful, thank you very much!
Best
Klaus
Re: Question about a simple user databse
Posted: Mon May 27, 2013 9:34 pm
by Simon
Super Dave!
Lots more fun to be had!
Simon
Re: Question about a simple user databse
Posted: Tue May 28, 2013 6:32 am
by snm
I like it, first time it's clear for me. Thanks Dave.
Marek
Re: Question about a simple user databse
Posted: Fri May 31, 2013 11:49 pm
by treefolk
Thanks so much for the tutorial. I now understand quite a bit more about it. It is much appreciated.