I’m stuck. I’ve spent many hours on this.
I have a simple fun app. It takes a picture (or uses an existing picture) and then draws and displays a random quote from an SQL database. I have everything coded for all the scenes in the app, have the sqlite database put together and have it inside the application folder, have the 'require “sqlite3” ', etc. on scene 3 (where the quote and picture will be displayed) but just can’t get the database code to work. In fact Director.lua won’t even recognize scene3.lua. However, if I comment out the database code in scene3.lua it recognizes scene3.lua with no problem and all the other functions in scene3 work.
I’ve tried using the code in the API, code from Dr. Burtons book, code from Dr. Hernandez’s video, but I’m completely confused. It’s so bad I don’t even want to show you the code I’ve used. It would be embarrasing.
Will someone be nice enough to share some code that will do the following. After the user takes a picture and saves it and it is placed on screen (that code is working great), I want to then grab a random quote (random row) from a database called ABC.sqlite that has only one column called “saying”. The quote could be long enough that it would have to fit on two or three lines. I then want to display that quote in a certain area on the screen, below the picture.
Also, what is the best way to trigger the database event. Should it be part of the function that takes the picture and places it or should it be a separate function with a separate listener or timer?
Sorry, guys. I’m new and confused but getting more and more confident every day. I love Corona and am determined to become good at it. Wish I was 8 years old so this would all come naturally to me andI could build a game in two weeks :-).
Thanks in advance.
Al [import]uid: 97852 topic_id: 19866 reply_id: 319866[/import]