My idea was picking a random number with math.random, let’s say math.random( 4 ). Having this number, I would like to write a function to take from a SQL table some sentences. The table has 2 colums: id and sentences. When the number randomly picked is equal to the id, the relative sentence (on the same line) is picked by my function. I’m a beginner and I only know I should use sqlite3 and I need some help, thank you very much.
A simple query will work
SELECT sentence FROM table WHERE id = <my random number>
For the lua code read the solar documentation
1 Like
if you want to use a local database then go for the documented SQLLite database
if you want a cloud based database, then this is a completely different story, you need a cloud based server, and a webservice that can talk to that server, finally using network.request you can communicate with the database via calling the webservice
Thank you very much. This seems to work
Thank you very much, there was a similar problem!