Newbe - MySQL syntax problem? --- SOLVED ---
Posted: Fri Jun 03, 2011 4:46 pm
Hi All, new to LiveCode...looks great so far!
I'm having an issue with the 'WHERE' clause in MySQL. I've looked through the dictionary and forum but cannot find a solution.
If I use this to pull out a specific record from the db all works as expected.
--------------
put "SELECT user FROM auth WHERE user='Jason' " into tSQL
//query the database ( format ready for table)
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
--------------
The problem is when I want to use a variable for the WHERE clause as below;
--------------
put "Jason" into tUsername
put "SELECT user FROM auth WHERE user='tUsername' " into tSQL
//query the database ( format ready for table)
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
--------------
This results in no data?
So the question is: How do I use a variable in the WHERE clause?
Thanks
Andy
I'm having an issue with the 'WHERE' clause in MySQL. I've looked through the dictionary and forum but cannot find a solution.
If I use this to pull out a specific record from the db all works as expected.
--------------
put "SELECT user FROM auth WHERE user='Jason' " into tSQL
//query the database ( format ready for table)
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
--------------
The problem is when I want to use a variable for the WHERE clause as below;
--------------
put "Jason" into tUsername
put "SELECT user FROM auth WHERE user='tUsername' " into tSQL
//query the database ( format ready for table)
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData
--------------
This results in no data?
So the question is: How do I use a variable in the WHERE clause?
Thanks
Andy