Jump to content

Variables Problems


Recommended Posts

HI all,

This is my first post so be gentle.:)

I am using autoit fore a few months now whit great success but I have a problem and I going in circles to find what I am doing wrong.

What I am attempting to do is to create a SQLite function that Update’s a value in a Colum.

The SQL string is "UPDATE Tabel SET Columname = 'value' WHERE Columname = ' value ';"

So the first thing I did is Just use a test example check if autoit understates what I am trying to do. It looks like this

_SQLite_Exec (-1, "UPDATE aTest SET c = 'test1' WHERE b = '3';"

This works well so I went forward to the next step and that is using variables in the string.

It looks like this.

$sTable = "aTest"
$sColumChange = "b"
$sValueChange = "3"
$sColumFind = "c"
$sValueFind = "test1"

_SQLite_Exec (-1,"UPDATE "&$sTable&" SET "&$sColumChange&" = '"&$sValueChange&"' WHERE "&$sColumFind&" = '"&$sValueFind&"';")

End now it not working any more

I have try putting the string in a new varibel and that is not working as well .

It looks like this

$sTable = "aTest"
$sColumChange = "b"
$sValueChange = "3"
$sColumFind = "c"
$sValueFind = "test1"



$SQLFINDSTRING = string("UPDATE "&$sTable&" SET "&$sColumChange&" = '"&$sValueChange&"' WHERE "&$sColumFind&" = '"&$sValueFind&"';")
_SQLite_Exec (-1,$SQLFINDSTRING)

I don’t understand where I am going wrong.

Can some point me in the ride direction?

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...