SQLite and Torque
by Nick Zafiris · in Torque Game Engine · 10/20/2004 (3:40 am) · 6 replies
Regarding the SQLite resource which is great and worked easy with TGE 1.3, I have a couple of questions.
Is there a way to insert variables in an INSERT statement?
For example, I have a table called "gamevars" and 2 fields "varname" and "value".
If I type this:
%query = "INSERT INTO gamevars (varname, value) VALUES ('player', '%player')";
instead of storing the contents of the %player variable, it stores the word %player.
Is it possible to store the contents of the %player variable?
Also, has anyone implemented any encryption? I'm planning on using this for saving and loading on a single player game, but as it is now, anyone can open the database file with a text editor and view/alter the data.
Thanks,
Nick
Is there a way to insert variables in an INSERT statement?
For example, I have a table called "gamevars" and 2 fields "varname" and "value".
If I type this:
%query = "INSERT INTO gamevars (varname, value) VALUES ('player', '%player')";
instead of storing the contents of the %player variable, it stores the word %player.
Is it possible to store the contents of the %player variable?
Also, has anyone implemented any encryption? I'm planning on using this for saving and loading on a single player game, but as it is now, anyone can open the database file with a text editor and view/alter the data.
Thanks,
Nick
#2
Now if we could add encryption to the database file it would be the absolute best solution for single player save-game functionality.
Nick
10/20/2004 (5:21 am)
Thanks, it works perfectly now!! Just had to replace your single quotes with the single quotes on my keyboard to make it work.Now if we could add encryption to the database file it would be the absolute best solution for single player save-game functionality.
Nick
#4
12/14/2007 (1:32 pm)
Hasn't it been able to do it for a while? I seem to remember Zend being able to interface with SQLite around 2k3/4 or so.
#5
12/14/2007 (2:06 pm)
I just learned it so call me a newbie. I didn't read that part in my PHP lessons. But thanks.
#6
12/14/2007 (2:23 pm)
That's alright. I just felt like I'd done the Timewarp...again!
Associate Ron Yacketta
%query = "INSERT INTO gamevars (varname, value) VALUES ('player', '" SPC %player SPC "')";