and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi there,
so I'm trying to remove some rows over 3 tables with this statement:
[syntax="sql"]DELETE
contents,
contentVersions,
images
FROM
contents,
contentVersions,
images
WHERE
contents.cid = 2 AND
contentVersions.cid = contents.cid AND
images.vid = contentVersions.vid
Works perfectly if executed through my QueryBrowser, but fails with PDO.
Anyone know why?
[s]thanks[/s] thanks!
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by SwizzCodes on Mon Aug 27, 2007 5:41 pm, edited 1 time in total.
Fatal error: Call to a member function execute() on a non-object in /Users/immanuelhaussermann/Sites/Netapplications/CMS/library/content/ContentManager.php on line 122
So the statement doesn't seem to be valid.
So I escape the execute command and it tells me:
[2] => Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
I don't get that one. I've used fetch() on the previous statement, so it shouldn't be buffered anymore, right?
fetch() only fetches one record from the result set. Is it possible that there are still other unfetched records in the result?
Also take a look at http://de2.php.net/PDOStatement-closeCursor
there is only 1 row to fetch.. and it's also limited to 1 in the query, but I've got around it by using fetchAll(). Not as nice as fetch(), but working.