Question about a simple user databse

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
treefolk
Posts: 16
Joined: Tue May 21, 2013 10:54 pm

Question about a simple user databse

Post by treefolk » Wed May 22, 2013 1:07 am

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

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Question about a simple user databse

Post by dave_probertGA6e24 » Wed May 22, 2013 6:17 am

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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Question about a simple user databse

Post by Simon » Wed May 22, 2013 6:47 am

Hi Dave,
Hmm, maybe I should do a tutorial myself on the subject!
I'd read it!!! N' stuff.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Question about a simple user databse

Post by dave_probertGA6e24 » Wed May 22, 2013 2:09 pm

Ok, Simon, you persuaded me :)

I've started work on it - it'll be ready in a couple of days.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

treefolk
Posts: 16
Joined: Tue May 21, 2013 10:54 pm

Re: Question about a simple user databse

Post by treefolk » Sun May 26, 2013 10:27 pm

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Question about a simple user databse

Post by Simon » Sun May 26, 2013 10:41 pm

Goooo Dave! :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Contact:

Re: Question about a simple user databse

Post by dave_probertGA6e24 » Mon May 27, 2013 7:08 pm

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
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Question about a simple user databse

Post by Klaus » Mon May 27, 2013 7:35 pm

Hi Dave,

wonderful, thank you very much!


Best

Klaus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Question about a simple user databse

Post by Simon » Mon May 27, 2013 9:34 pm

Super Dave!
Lots more fun to be had!

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Question about a simple user databse

Post by snm » Tue May 28, 2013 6:32 am

I like it, first time it's clear for me. Thanks Dave.

Marek

treefolk
Posts: 16
Joined: Tue May 21, 2013 10:54 pm

Re: Question about a simple user databse

Post by treefolk » Fri May 31, 2013 11:49 pm

Thanks so much for the tutorial. I now understand quite a bit more about it. It is much appreciated.

Post Reply