Sign in to follow this  
Followers 0
chirimbol

SQLite Query Help

4 posts in this topic

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

No problem :whistle:

Share this post


Link to post
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
Sign in to follow this  
Followers 0