davehope has asked for the wisdom of the Perl Monks concerning the following question:
When looking at the trace, it seems to go through the motions of binding the param, but doesn't.my $blogTagToShow = shift; my $dbh = DBI->connect("dbi:SQLite:dbname=$db"); $dbh->trace(4); my $query = "SELECT * FROM tblBlogPosts WHERE fldTags LIKE '%?%' ORDER + BY fldDate DESC"; my $sth = $dbh->prepare($query); $sth->bind_param(1, $blogTagToShow); $dbh->trace(0);
Anyone got any ideas ? Cheers!, Davesqlite trace: prepare statement: SELECT * FROM tblBlogPosts WHERE fldT +ags LIKE '%?%' ORDER BY fldDate DESC at dbdimp.c line 258 <- prepare= DBI::st=HASH(0x93bba20) at Libraries//libBlog.pm line +42 via at index.pl line 152 -> bind_param for DBD::SQLite::st (DBI::st=HASH(0x93bba20)~0x93b64 +ec 1 'windows') sqlite trace: bind into 0x93b6504: 1 => windows (0) pos 0 at dbdimp.c line 464 <- bind_param= 1 at Libraries//libBlog.pm line 43 via at index.pl + line 152 -> trace for DBD::SQLite::db (DBI::db=HASH(0x93b62dc)~0x93b627c 0) <- trace= 4 at Libraries//libBlog.pm line 45 via at index.pl line + 152 -> execute for DBD::SQLite::st (DBI::st=HASH(0x93bba20)~0x93b64ec) sqlite trace: execute at dbdimp.c line 325 sqlite trace: Execute returned 6 cols
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI:SQLite bind_param problem
by roboticus (Chancellor) on Jun 17, 2007 at 17:24 UTC | |
|
Re: DBI:SQLite bind_param problem
by shmem (Chancellor) on Jun 17, 2007 at 17:25 UTC | |
by davehope (Initiate) on Jun 17, 2007 at 17:35 UTC | |
|
Re: DBI:SQLite bind_param problem
by andreas1234567 (Vicar) on Jun 18, 2007 at 08:34 UTC |