Gumma Posted May 2, 2011 Posted May 2, 2011 $QSID = 90620;this would normally be dynamic $sql = _MySQLConnect("DataMiner", "", "DataMiner", "10.40.32.45") ;$var = _Query($sql, "SELECT * FROM patients WHERE patient_id = '0906200'") $var = _Query($sql, """SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'""") I have been having a problem with the _Query command. I need to make the query dynamic based on a patient identifier, $QSID. The code works if I uncomment line 2 and comment line 3 (thus making it a static query), however, I believe they say the same thing. is my formatting wrong? If I turn $sql = _MySQLConnect("DataMiner", "", "DataMiner", "10.40.32.45") ;$var = _Query($sql, "SELECT * FROM patients WHERE patient_id = '0906200'") $var = _Query($sql, """SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'""") I did a test and made $query = """SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'""" msgbox(0,"",$query) and it appears to yield the same input data as line two. Any help would be greatly appreciated. error consult: mysql.au3 (48) : ==> The requested action with this object has failed.: Return $oConnectionobj.execute ($sQuery) Return $oConnectionobj.execute ($sQuery)^ ERROR ->13:52:34 AutoIT3.exe ended.rc:1
z0mgItsJohn Posted May 2, 2011 Posted May 2, 2011 Wouldn't it be : _Query("SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'")? Latest Projects :- New & Improved TCP Chat
Gumma Posted May 2, 2011 Author Posted May 2, 2011 Wouldn't it be : _Query("SELECT * FROM patients WHERE patient_id = '0" & $QSID & "0'")?Wow I am a knuckle head. Thanks so much - I can't believe I've been banging my head against that for a half hour now. I don't know why I was thinking that the double quotes were needed. Thanks so much!!!
z0mgItsJohn Posted May 2, 2011 Posted May 2, 2011 No problem bro, I actually just happened to check this forum and noticed your post in the help section and wanted to see if I could help, glad I could help . Latest Projects :- New & Improved TCP Chat
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