[CS-FSLUG] Re: Perl and DBD::MySQL
Timothy Butler
tbutler at ofb.biz
Fri Jul 1 19:22:34 CDT 2005
Oh, I should add, that the variables are properly escaped in Perl so
that Perl doesn't think they are arrays (e.g. "\@num"), so that isn't
causing a problem.
-Tim
---
Timothy R. Butler | "Turning and turning in the widening gyre
tbutler at ofb.biz | The falcon cannot hear the falconer;
timothybutler.us | Things fall apart; the centre cannot hold;
uninet.info | Mere anarchy is loosed upon the world..."
-- W. B. Yeats
On Jul 1, 2005, at 7:19 PM, Timothy Butler wrote:
> I'm going crazy. Is there anyway that anyone knows of to send
> multiple MySQL queries within one "execution" of DBD::MySQL? I want
> to set a MySQL variable (e.g. "SET @num=0;") before doing the main
> query. I tried to do this:
>
> SET @num=0;UPDATE mypage SET mypageorder=(@num:=@num+1) WHERE
> uid=1030 ORDER BY `mypageorder`;
>
> However, Perl does not seem to allow me to include those two
> "queries" at the same time. If I do not explicitly set @num,
> however, the value returned in the UPDATE query is NULL, since @num
> has not been declared previously. Any ideas?
>
> Thanks,
> Tim
>
> ---
> Timothy R. Butler | "Turning and turning in the widening gyre
> tbutler at ofb.biz | The falcon cannot hear the falconer;
> timothybutler.us | Things fall apart; the centre cannot hold;
> uninet.info | Mere anarchy is loosed upon the world..."
> -- W. B. Yeats
>
>
> _______________________________________________
> ChristianSource FSLUG mailing list
> Christiansource at ofb.biz
> http://cs.uninetsolutions.com
>
More information about the Christiansource
mailing list