placeholders in mySQL queries

Toma Tasovac ttasovac at princeton.edu
Wed Feb 4 17:48:20 EST 2004


OK, this was dumb.  My database is UTF8, which is why, it turns out, I 
had to unidecode tFormID to make this work...  I'm just posting it here 
in case somebody encounters the same problem.


On Feb 1, 2004, at 12:01 PM, Toma Tasovac wrote:

> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list