in reply to Querying Meta Data
To make this useful, do something likeSELECT n.id FROM nodes n, meta_data md WHERE md.name = "color" AND md.value = "green" AND n.id = md.node_id ORDER BY 1
Placeholders are your friend.my $sql = <<'__END__'; SELECT n.id FROM nodes n, meta_data md WHERE md.name = ? AND md.value = ? AND n.id = md.node_id ORDER BY 1 __END__ my $sth = $dbh->prepare_cached($sql) || die $!; $sth->execute($attr, $value) || die $!; # Use your favorite fetch*() method here $sth->finish;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Querying Meta Data
by simonm (Vicar) on Jul 24, 2003 at 18:58 UTC | |
by eric256 (Parson) on Jul 24, 2003 at 20:07 UTC | |
by simonm (Vicar) on Jul 24, 2003 at 23:39 UTC | |
by eric256 (Parson) on Jul 24, 2003 at 23:53 UTC |