The code below creates a database, then reads it but it fails when I try to
match an apostrophied name.
Any suggestions as to where I am going wrong would be much appreciated.
Owen
===
#!/usr/bin/perl -w
use strict;
use
First, in SQLite, single quotes in strings are not escaped. They are
instead doubled. For example,
O'Jones
should be the SQL string
'O''Jones'
(that's standard SQL behavior). It MySQL that makes it different with quotes.
Second, if you really need to quote a string to
Owen wrote:
The code below creates a database, then reads it but it fails when I
try to match an apostrophied name.
Any suggestions as to where I am going wrong would be much
appreciated.
$SQL = select * FROM tennisclub where last LIKE '%$name%' ;
$cursor = $dbh-prepare($SQL);
Just DO NOT place values into SQL commands, use placeholders. It makes
reusing SQL statements easier, it avoids all kinds of quoting issues,
reduces the lines of code you need to write, and (in a web environment)
avoids SQL injection, a common path for all kinds of attacks.
Your Code:
$SQL =
You are trying to link 32bit code with 64bit code. You either need to get
the 64bit version of the Sybase client libraries, or rebuild perl in 32bit
mode.
Michael
Extranet
[EMAIL PROTECTED] - 09/09/2006 00:48
To:dbi-users
cc:
Subject:trouble loading DBD sybase, 1_07_01
Hi,
I am