placeholders in mySQL queries

Toma Tasovac ttasovac at princeton.edu
Sun Feb 1 06:01:22 EST 2004


Hello everybody.

Does anybody have any idea why this works:

global tDatabaseID
global tFormID

on mouseUp
   put unidecode (char 1 to -1 of fld "pronunciation", "utf8") into 
updatedPronunciation
   put "UPDATE entry SET entry.pronunciation =:1 WHERE entry.formID 
='4'" into tQuery
   revExecuteSQL tDatabaseID,tQuery,"updatedPronunciation"
   put the result
end mouseUp

BUT why using two placeholders instead of one does not????

global tDatabaseID
global tFormID

on mouseUp
   put unidecode (char 1 to -1 of fld "pronunciation", "utf8") into 
updatedPronunciation
   put "UPDATE entry SET entry.pronunciation =:1 WHERE entry.formID =:2" 
into tQuery
   revExecuteSQL tDatabaseID,tQuery,"updatedPronunciation", "tFormID"
   put the result
end mouseUp


In the second case, even though "tFormID" evaluates to 4, making it 
exactly the same as the first example, the result is always 0, and no 
update is being made.

All best,
Toma



More information about the use-livecode mailing list