database access

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
jstrahan
Posts: 10
Joined: 2013-04-28 03:36

database access

Post by jstrahan » 2013-05-07 04:30

is there a way for me to access the database from an app.
basically im using appgini to create a backend office where management is the only one that can add info to the database
users can signup on web site but cant view any info from the website
then im creating an iphone app where the app will access the database info but only if they are a registered user

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: database access

Post by KSan » 2013-05-07 04:39

Yes. This is possible. Which SDK are you using for iPhone development? Native?

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 07:07

corona

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: database access

Post by KSan » 2013-05-07 07:50

Great! Same here.

See http://omnigeek.robmiracle.com/2012/04/ ... -services/

All info you need is in there. If you want more detail you might want to check out MasteringCoronaSDK.com Business Apps Edition. Covers this type of access step by step.

Good luck!

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 10:42

thx

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: database access

Post by KSan » 2013-05-07 20:00

You're most welcome. Let me know if you get stuck. You can find me here or on the Corona forum (same forum name). All the best.

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 21:08

thx im working though the example now then ill try to connect to the appgini db

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 21:15

working though the example
maybe i didnt setup the database correct for the password
i keep getting error 403 forbidden

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 21:36

i think i got it
i changed this line of code
if (strcmp($player["password"],md5($password)) == 0) {
to this
if (strcmp($player["password"],md5($password)) == 1) {
and it seems to work

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 21:38

nope i was wrong this lets any password work so its got to be the password field is not setup correct in the database

jstrahan
Posts: 10
Joined: 2013-04-28 03:36

Re: database access

Post by jstrahan » 2013-05-07 22:35

ok now i know for sure its the md5 encryption giving me problems
just need to figure out how to make that work

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: database access

Post by KSan » 2013-05-08 04:17

Why not go simple and make it work first with an unencrypted password? Create a user on the db with minimal rights so you don't care if someone snoops that passw for now. Just an idea.

Post Reply