When i do this:
I'm actually expecting one single item for return and NOT an entire array. For example iam expecting 1 filed only (pagecounter that is) that will hold lest say number 75. This is one number so it seems logical to me to store it on a single variable, so i dont get why the baove aint working.my $counter = 'SELECT pagecounter FROM counters WHERE pagename = ?' +, undef, $pagename;
In your response you are saying and semantically (assigning that list to the $counter variable isn't going to help you get the counter from the DB, is it?): Why you say list? i think iam expecting an item only not a bunch of items(list)
Also:
If for some reason we expect an array why doesn't the following code work as well? I'm considering that 'list' and 'array' are the same thing, both are a bunch of values, right?:my ($counter) = $db->selectrow_array( 'SELECT pagecounter FROM counters WHERE pagename = ?', undef, $pagename);
What exactly is the difference between ($counter) and @counter ?my @counter = $db->selectrow_array( 'SELECT pagecounter FROM counters WHERE pagename = ?', undef, $pagename);
And the last thing is that i dont understand although you tried to expalin it to me the use of method 'selectrow_array'. Is it really necessary to tell it we are grabbing an array? doesn't the 'select' do this by its own?
As you can see i'am really confused....
ps. When i want to print variable counter i do 'print $counter' or 'print ($counter)' ?
In reply to Re^10: Making an automatic counter adder for all webpages
by Nik
in thread Making an automatic counter adder for all webpages
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |