Hi guys
HELP!
We have been trying to code a simple front end to SQlite3 (in Puppy 4.xx series)
Enclosed is the gtkdialog3/Bash code we are using to call the SQLite Database file - PuppDB
This is the line we are trying to call from the InsertData button
Code: Select all
sqlite3 PuppDB "insert into info values ('"$INPUTNAME"','"$INPUTINFO"','"$INPUTURL"');"
How do we do this?
In order to examine the PuppyDB file and any changes you require sqlitestudio (also enclosed below)
This is a massive but complete binary for creating and examining sqlite databases
You can download the below code, the PuppDB and SQLitestudio from here
http://tmxxine.com/pupdb/puppdb.tar.gz
Code: Select all
#! /bin/bash
#! /usr/sbin/gtkdialog3 -e
# Puppy Database ver 0.4 created by Lobster and Shadow
# for Puppy DeepThought and Linux Tmxxine
# Feb 2009 GPL v3 License
# http://tmxxine.com
export Puppybase='
<window title="PuppyDB SQLite3">
<vbox>
<hbox>
<text><label>Add info</label></text>
</hbox>
<hbox>
<text><label>Name</label></text>
<entry><variable>INPUTNAME</variable></entry>
</hbox>
<hbox>
<text><label>Info</label></text>
<entry><variable>INPUTINFO</variable></entry>
</hbox>
<hbox>
<text><label>URL</label></text>
<entry><variable>INPUTURL</variable></entry>
</hbox>
<hbox>
<button help>
<action>`Xdialog --wrap --screencenter --left --title "Pwget - HELP" --msgbox "Puppy Database is a simple front end to SQLite3 for 4.xx series Puppy including Dingo, 4.1.2 and Deep Thought (under development) This version is pre-Alpha quality. \n\n Lobster & Shadow, Feb 2009" 600x0`</action>
</button>
<button cancel></button>
<button><action>insert</action><label>InsertData</label></button>
</hbox>
</vbox>
</window>'
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 --program=Puppybase --center); do
eval $STATEMENTS
done
IFS=$I
function insert(){
sqlite3 PuppDB "insert into info values ('"$INPUTNAME"','"$INPUTINFO"','"$INPUTURL"');"
}