I wrote a product/item/blog/calendar search engine in Perl that used flat files.
It worked really good for the < 200 items I usually have to deal with. But then, when it was about 3000, it started getting slow, but still pretty good.
Now I'm looking at adding about 12,000 items, and it obviously is going to need mySQL.
I don't want to rewrite everything... at least not this week.
I only started using/learning DBI and MySQL yesterday, so my brain is pretty fried.
(and I've already converted the data into a MySQL table.)
after preparing and executing the query (which does run properly. I can get an array of an array of results, but that doesn't help me without the name of the columns)...
Code:
$stb = $DB->prepare("select * from datatable where $items regexp ? ");
$stb->execute(($regc));
the following code was in a tutorial, and it says it's supposed to work...
Code:
my %trow = map { $_->[1], $_->[2]} @{$stb->fetchall_arrayref({})};
foreach my $tr (keys (%trow)){
print "Hash $tr: $trow{$tr}\n";
}
...but alas, no.
Any suggestions on getting the results into a hash o' hashes?
ie: $results{$item_num}->{$field}
And I am still looking for a MySQL/DBI tutorial that progresses in difficulty in a reasonable manner. How come most tutorials' chapter 1 covers "What is a Database?" and Chapter 2 covers advanced coding with the assumption that the reader has at least a masters in computer science?
Thanks!