Jump to content

SQLite Query Help


Recommended Posts

Hi,

I just begin using SQLite with autoIt and i have no problem when testing to create, insert or doing query with my database.

Now my problem is I want to insert data in my database directly from variables (i.e. input from user), and I can't....

Here is my code below, of course this code insert $date in my database row and not the value of $date.

How can I do to insert the real value of my Autoit variable.

_SQLite_Exec -1, ("INSERT INTO mytable (date,text,rest) VALUES ('$date','Diligencia herederos sra sanchez','8');")

Thanks for your help.

Link to comment
Share on other sites

hah. New to Autoit? Try this...

$sqlstring="INSERT INTO mytable (date,text,rest) VALUES ('"&$date&"','Diligencia herederos sra sanchez','8');"
_SQLite_Exec -1, ($sqlstring)

The '&' signs (without single quotes), connects variables to strings, etc.

Link to comment
Share on other sites

Exactly what i want! :whistle:

Thanks.

hah. New to Autoit? Try this...

$sqlstring="INSERT INTO mytable (date,text,rest) VALUES ('"&$date&"','Diligencia herederos sra sanchez','8');"
_SQLite_Exec -1, ($sqlstring)

The '&' signs (without single quotes), connects variables to strings, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...