Re: PDO/MYSQL Problem
- From: macca <ptmcnally@xxxxxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 13:21:23 -0700 (PDT)
ok,
I changed the statement to this
$pdo->exec("INSERT INTO file(filename) VALUES('$file')") or
die(print_r($pdo->errorInfo()));
And go this error
Array ( [0] => 42000 [1] => 1064 [2] => You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'â/îÚ{%9²°†3äìÛZûòæÝc¤6öîÏË»7Ëe¬"µ
\ß-Tˆ¿…JÒ<ÈTA‡‰Zîî V›»Y„a”ªeyG«$WËÃÝGoé' at line 1 ) 1
So then i added addslashes() to the file_get_contents() like so:
$file = addslashes(file_get_contents('document.pdf'));
and it worked fine.
Thanks Jerry
.
- Follow-Ups:
- Re: PDO/MYSQL Problem
- From: Jerry Stuckle
- Re: PDO/MYSQL Problem
- References:
- PDO/MYSQL Problem
- From: macca
- Re: PDO/MYSQL Problem
- From: Jerry Stuckle
- PDO/MYSQL Problem
- Prev by Date: Mmm, that tastes sexy!
- Next by Date: Simple XML - difficult parsing
- Previous by thread: Re: PDO/MYSQL Problem
- Next by thread: Re: PDO/MYSQL Problem
- Index(es):
Relevant Pages
|