Results 1 to 3 of 3
Thread: PDO Quote
Jun 27, 2010, 08:21 #1
I spent an hour trying to get this right and reading documentation but can't seem to get it right. I can't get the strings to "escape", I'm not sure how to issue the quote() statement.
$this->DB = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME", $DB_USER, $DB_PASS);
// How do I get this to escape string?
$this->STMT = $this->DB->prepare($strData);
[06-27-2010 12:19pm] 42000 | 1064 | 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 'a w'ebsite abut something',`listing_id` = '8' WHERE listing_id = '8'' at line 2
It appears that PDO has a Base Class and a Statement class. To use the PDOStatements It seems that the PDO Base class has some sort of __toString() method which passes me over to PDOStatement.
Jun 27, 2010, 08:22 #2
- Join Date
- Apr 2008
- North-East, UK.
- 3 Post(s)
- 0 Thread(s)
Jun 27, 2010, 08:28 #3