Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: How to access an Array Element

by SamCG (Hermit)
on Apr 04, 2006 at 21:10 UTC ( #541222=note: print w/replies, xml ) Need Help??

in reply to How to access an Array Element

Hmm, okay, you're using a database query method I'm not familiar with to get your array. If you were using something like:

while (my @row = $sth->fetchrow_array){@search=($row[2]);}
I'd understand a bit better. You specify in other post that your query only returns one row in this case, but what does your array look like if your query returns more than one row?

So, you use my @currentpoll = LSRfm::Database::Data->search(field => 'currentpoll'); to get your array. Does this technique fetch rows sequentially? If so, put your fetch into a loop and then use $row[2] to access the content field, pushing it into an array with push @search, $row[2] if you need to compile a list for your next function. Of course, you'll also be safe doing this if you're sure you'll always get one row (which is what the OP looked like), but in that case I'm not sure why you need the single field in an array (though you can still do it).

s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://541222]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-02-01 01:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found