emgi has asked for the wisdom of the Perl Monks concerning the following question:
(Above is the working query, just for informational purposes.)$sth = $dbh->prepare("select author, title, language, format, filename +, fullpath, category, tags from ebooks where author like'%$searchauth +%' and title like'%$searchtitle%' and language='$searchlang' and form +at='$searchfmt' and category like'%$searchcategory%' and tags like'%$ +searchtags%' LIMIT 50;");<br/>
When removing the # from the lines containing the print statements, the output is what you would expect; i.e. results are being returned from the query. My problem is how to put them into the array. I do use 'strict' and the program returns no syntax errors. /emgi$sth->execute(); $loopcount = 0; while ($row = $sth->fetchrow_arrayref()) { # print "@$row[0] @$row[1] @$row[2] @$row[3] \n"; print "File found: @$row[4] \n"; # print "Category: @$row[6] Tags: @$row[7]\n\n"; $author = @$row[0]; $title = @$row[1]; $results[$loopcount] [1] = (@$row[1]); THIS LINE IS NOT WORKING. $language = @$row[2]; $format = @$row[3]; $filename = @$row[4]; $fullpath = @$row[5]; $category = @$row[6]; $tags = @$row[7]; print "$loopcount $results[$loopcount] [1]"; $loopcount++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multidimensional array's
by 2teez (Vicar) on Dec 27, 2012 at 19:48 UTC | |
|
Re: multidimensional array's
by NetWallah (Canon) on Dec 27, 2012 at 23:40 UTC | |
by space_monk (Chaplain) on Dec 28, 2012 at 10:43 UTC | |
by NetWallah (Canon) on Dec 28, 2012 at 20:11 UTC | |
by emgi (Initiate) on Dec 29, 2012 at 09:20 UTC | |
by NetWallah (Canon) on Dec 29, 2012 at 15:56 UTC | |
|
Re: multidimensional array's
by LanX (Saint) on Dec 27, 2012 at 20:50 UTC | |
|
Re: multidimensional array's
by Cristoforo (Curate) on Dec 27, 2012 at 21:26 UTC | |
|
Re: multidimensional array's
by 7stud (Deacon) on Dec 27, 2012 at 21:10 UTC |