coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
Also, I'm used to selecting a number of rows from a mysql database and running over it with sth->fetch and bind_column. Is there a way I can set a variable to a one-column select? Ie. my $name = qq(select name from db where id="1");
My current problem is
my $data = qq(SELECT catname, path FROM categories WHERE path =~ m/ +^$path/ && path != "$path"); my $sth = $dbh->prepare($data); $sth->execute() or die $dbh->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to use regexes in SELECT statement
by agianni (Hermit) on Mar 30, 2007 at 02:52 UTC | |
|
Re: how to use regexes in SELECT statement
by Herkum (Parson) on Mar 30, 2007 at 01:58 UTC | |
|
Re: how to use regexes in SELECT statement
by davorg (Chancellor) on Mar 30, 2007 at 09:24 UTC | |
|
Re: how to use regexes in SELECT statement
by johngg (Canon) on Mar 30, 2007 at 09:18 UTC |