List:General Discussion« Previous MessageNext Message »
From:Mark Date:May 15 2002 9:59am
Subject:Re: mixed up variables || solution found
View as plain text  
----- Original Message -----
From: "Sven Bentlage" <root@stripped>
To: <mysql@stripped>
Sent: Wednesday, May 15, 2002 5:18 AM
Subject: mixed up variables


> Can anybody help me figure out how to correct that?
>
>
> Thank you for your help.
>
> sven
> code:
> my $sth = $dbh->prepare(
> "select *
> from memberscopy
> where name = '$f_name' and surname = '$f_surname' "
> );


If you want variables, binding is a good idea, as it is fast over many
MySQL iterations; but why not tie multiple variables in one stroke?

    $sth -> execute;
    $sth -> bind_columns (undef, \$u_id, \$u_surname ... );

Or get all in one array,

    my @results = $sth -> fetchrow_array;

- Mark

Thread
mixed up variablesSven Bentlage15 May
  • Re: mixed up variables || solution foundSven Bentlage15 May
    • Re: mixed up variables || solution foundColin Faber15 May
    • Re: mysql errorColin Faber15 May
Re: mixed up variables || solution foundMark15 May