Page 1 of 1

How to include database?

Posted: Fri Aug 23, 2013 7:09 pm
by ECNU4271
Hi, all!

I am a completely beginner on programming.

But by using Live Code, I've already built my iOS app's all interfaces. It looks great but they are all dummy pages.

I now just wonder how can I make use of a database so that I can record account information?

What tool should I get? Is there a tutorial about it?

I have a Mac. I have no experience in any knowledge of database.


Thanks for any advice!
Michael

Re: How to include database?

Posted: Fri Aug 23, 2013 7:20 pm
by dunbarx
Hi.

LiveCode has SQLlite capability built-in. But do you need to use such a thing? Will you have so many records that speed will be an issue?

Otherwise, even with datasets of many, many thousands of records, LC can manage easily and quickly. A basic table field works pretty well for that.

How much data are we talking about?

Craig Newman

Re: How to include database?

Posted: Fri Aug 23, 2013 7:20 pm
by ECNU4271
What way/database will be the most convenient way to do this? Because the database would only have two tables to meet my need. Thanks! Keep waiting for any idea!

Re: How to include database?

Posted: Fri Aug 23, 2013 7:23 pm
by ECNU4271
dunbarx wrote:Hi.

LiveCode has SQLlite capability built-in. But do you need to use such a thing? Will you have so many records that speed will be an issue?

Otherwise, even with datasets of many, many thousands of records, LC can manage easily and quickly. A basic table field works pretty well for that.

How much data are we talking about?

Craig Newman

Thanks for the rapid reply.

In my thoughts, there will be two tables in the database. One is about account details(including name, password, etc.).
The other is about course details (including time, duration, place. attenders etc.).

I need the information on my app refreshing from database real-time.

How can I achieve this?

Many thanks!

Re: How to include database?

Posted: Fri Aug 23, 2013 7:30 pm
by dunbarx

Re: How to include database?

Posted: Fri Aug 23, 2013 7:49 pm
by ECNU4271

Thanks. I've already downloaded and looked at this SQLlite Example.
The example shows how to create a database manually by clicking. What I need is that the database is already there. When user uses, they register(the information goes into database) and then they can log in(verify the information from the database).

How to do that?

Thanks!
Michael

Re: How to include database?

Posted: Fri Aug 23, 2013 7:50 pm
by BvG
You could also store your data in text files as lists with delimiters, no need to learn sql for small and easy information like that ;)

for mobile:

Code: Select all

put field 1 into url ("file:" & the documents folder)
for desktops:

Code: Select all

ask file ""
if it <> "" then
   put field 2 into url ("file" & it)
end if

Re: How to include database?

Posted: Fri Aug 23, 2013 7:55 pm
by ECNU4271
BvG wrote:You could also store your data in text files as lists with delimiters, no need to learn sql for small and easy information like that ;)

for mobile:

Code: Select all

put field 1 into url ("file:" & the documents folder)
for desktops:

Code: Select all

ask file ""
if it <> "" then
   put field 2 into url ("file" & it)
end if
Thanks BvG,

Not just store. Those data needs to be verified when user logs in. The data need to be retrievable so that other pages can see the status of one course.

Does text file still work in this case?

Michael

Re: How to include database?

Posted: Sat Aug 24, 2013 1:06 pm
by BvG
Why wouldn't it? What you want sounds like it's a server tho, and not storage on iOS. Which of course introduces different problems, and solutions, like using ftp to upload data, or facilitating remote access to a hosted sql database, with all their security problems and added complexities.

Re: How to include database?

Posted: Sat Aug 24, 2013 1:15 pm
by Klaus
BvG wrote:...for mobile:

Code: Select all

put field 1 into url ("file:" & the documents folder)
Hmmm, I would rather supply a FILENAME here, too:

Code: Select all

put field 1 into url ("file:" & the documents folder & "/my_prefs_file.txt")
8)

Re: How to include database?

Posted: Sat Aug 24, 2013 1:18 pm
by BvG
Klaus wrote:removed
shh... let them find out by themselves ;)

Re: How to include database?

Posted: Sat Aug 24, 2013 5:29 pm
by ECNU4271
BvG wrote:Why wouldn't it? What you want sounds like it's a server tho, and not storage on iOS. Which of course introduces different problems, and solutions, like using ftp to upload data, or facilitating remote access to a hosted sql database, with all their security problems and added complexities.
Yes, it's more like a server! But how could I do it?

Re: How to include database?

Posted: Sat Aug 24, 2013 8:30 pm
by BvG
http://revolution.byu.edu/internet/RevInternet.php

put url "http://your.server.this.is.not/file.txt" into filed 1
put field 1 into url "ftp://john:passwd@ftp.example.net:2121/data.txt"

that's one way... see the dictionary:

url
ftp
http
launch
save
put
get
post