in reply to Re^2: DBI variable argument count
in thread DBI variable argument count
I guess I need to learn how to do my SQL differently.my $request = "SELECT * FROM dbname WHERE unit = ? AND name1 REGEXP ? +AND email REGEXP ? ORDER BY unit" my $dbh = DBI->connect("DBI:mysql:database=database;host=localhost", " +user", "passwd",{'RaiseError' => 1}); my $sth = $dbh->prepare($request); $sth->execute("001", "duckman", "google.com"); while (my $ref = $sth->fetchrow_hashref()) { # here is where the magic happens h3("this should be running but isn't"); h3("Unit $ref->{'unit'}"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBI variable argument count
by brap (Pilgrim) on Sep 14, 2012 at 17:08 UTC | |
|
Re^4: DBI variable argument count
by anothersmurf (Novice) on Sep 15, 2012 at 02:06 UTC | |
|
Re^4: DBI variable argument count
by anothersmurf (Novice) on Sep 14, 2012 at 21:53 UTC | |
by CountZero (Bishop) on Sep 15, 2012 at 17:32 UTC |