[CS-FSLUG] Re: Perl and DBD::MySQL
Don Parris
gnumathetes at gmail.com
Mon Jul 4 00:11:44 CDT 2005
On 7/1/05, Timothy Butler <tbutler at ofb.biz> wrote:
> 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
> >
> > ---
I wish I could help, Tim! I'm just trying to grasp Python. Not doing
too shabby, but I've got a long way to go yet. I do know a Perl guy
here, so I'll see if he can suggest anything. I don't think he's
familiar with DBD::MySQL, but who knows?
Don
--
DC Parris GNU Evangelist
http://matheteuo.org/
gnumathetes at gmail.com
Free software is like God's love -
you can share it with anyone anywhere anytime!
More information about the Christiansource
mailing list