radienergos Posted January 6, 2007 Share Posted January 6, 2007 HI , im trying to do a simple query using mysql.udf $pcnm=@computername _Query($sql, "UPDATE games.keys SET lockedby='' where lockedby ="&$pcnm) and i always get a unknown column 'lalala' where clause..... (lalala = computername) if a put numbers instead of chars its ok (the field is varchar) Link to comment Share on other sites More sharing options...
therks Posted January 6, 2007 Share Posted January 6, 2007 You didn't put quotation marks around computer name.@ComputerName is a string, correct? Well (and this IS a MySQL thing btw) when you use a string in a MySQL query, you have to put quotation marks (single or double) around it. So, the query you want is something like this:UPDATE games.keys SET lockedby = '' where lockedby = 'Unicron'(Unicron is the name of my computer)What you're sending now is:UPDATE games.keys SET lockedby = '' where lockedby = UnicronThat's why if you use numbers it works fine, because numbers are not string, and thus don't need to be surrounded by quotes.So in your AutoIt string, you want to do something like this:$pcnm = @computername _Query($sql, "UPDATE games.keys SET lockedby='' where lockedby = '" & $pcnm & "'") My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
radienergos Posted January 6, 2007 Author Share Posted January 6, 2007 thanks for the reply i tried that but it didn't work after a lot of tries and various combinations , i did it $pcnm=@computername $pcnm="'"&$pcnm&"'" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now