in reply to Re: DBI variable argument count
in thread DBI variable argument count
There is a matching row in that DB but for some reason it just doesn't print anything in the while loop. :($request = "SELECT * FROM nsmw WHERE unit = ? AND name1 REGEXP ? AND e +mail REGEXP ? ORDER BY unit" @values = ("001", "duckman", "google.com"); # Do database transaction my $dbh = DBI->connect("DBI:mysql:database=db;host=localhost", "user", + "user",{'RaiseError' => 1}); my $sth = $dbh->prepare($request); $sth->execute(@values); while (my $ref = $sth->fetchrow_hashref()) { # here is where the magic happens h3("Unit $ref->{'unit'}"); }
I think maybe I'm just too tired. I've been coding for 9 hours without a break =)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DBI variable argument count
by ig (Vicar) on Sep 14, 2012 at 02:50 UTC |