in reply to bind_columns error

Am I missing something?

Where are $UIDholder, $indexmonths, $indesxmonths, $indexyears defined?

Why are you calling bind_columns on a statement handle without placeholders?

Normally, I see things like this:

my $sql = 'insert into news values ( ?, ?, ? )'; ... $sth->bind_columns( $placeholder, $filler, $variables );

I don't recall the semantics, but something similar ought to work with placeholders in a select statement. The docs would probably help confirm.

Update: Ugh, you're right, runrig. I suppose I should've checked the docs myself instead of making an assumption based on faulty memory.

For those still reading, ignore the above text :)



--chargrill
$,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}

Replies are listed 'Best First'.
Re^2: bind_columns error
by runrig (Abbot) on Jun 30, 2006 at 18:46 UTC
    Where are $UIDholder, $indexmonths, $indesxmonths, $indexyears defined?
    The OP says in a later post that they are defined at the top of the program.
    Why are you calling bind_columns on a statement handle without placeholders?
    bind_columns() binds the select columns to variables, and affects where the data goes during fetch(). You are thinking of bind_params(), which binds placeholders and is called before execute(), and you usually don't even need to use bind_params() explicitly since you can supply the param arguments directly to execute().