- or download this
|-------------------| |-------------------|
| TBL NAME = Article | | TBL NAME = Author |
...
| title varchar(255) | | author varchar(32) |
|other fields | | other fields |
--------------------- ---------------------
- or download this
$article->author
- or download this
package MPDatabase::Article;
...
__PACKAGE__->might_have( author_class => 'MPDatabase::Author' => qw/au
+thor email/);
1;
- or download this
package MPDatabase::Author;
...
__PACKAGE__->has_many(articles => 'MPDatabase::Article');
1;
- or download this
!/usr/bin/perl -w
#
...
print $article->author, "\n";
# This program does not produce any output
- or download this
<--- parse_params
mysql_st_internal_execute
Binding parameters: SELECT authorid
FROM author
WHERE authorid = '5'
- or download this
SELECT authorId
FROM author A, article B
WHERE A.authorID = B.authorId and B.articleId = 5