ID: 29806 Updated by: [EMAIL PROTECTED] Reported By: jamslam at gmail dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: RedHat 9 PHP Version: 5.0.1 New Comment:
It's already documented: "SQLite will execute multiple queries separated by semicolons, so you can use it to execute a batch of SQL that you have loaded from a file or have embedded in a script. However, this works only when the result of the function is not used - if it is used, only the first SQL statement would be executed. Function sqlite_exec() will always execute multiple SQL statements. When executing multiple queries, the return value of this function will be FALSE if the was an error, but undefined otherwise (it might be TRUE for success or it might return a result handle)." Previous Comments: ------------------------------------------------------------------------ [2004-08-24 08:45:19] [EMAIL PROTECTED] This is not a bug but a very confusing thing. When ever you use the return value to the query() method (like you do with "return") the function will only execute one query in your chained list. In order to fix this you need to use the exec() method (but this one discards the return value). This definitely needs to be mentions in the documentation though. ------------------------------------------------------------------------ [2004-08-24 04:00:37] jamslam at gmail dot com Description: ------------ Alright, this is a strange bug, but I'll get to the point. For some odd reason PHP is not letting me pass chained queries in through a method, and from there execute the query successfully. I find that if I use the transactions ('BEGIN;' and 'COMMIT;') no queries will be executed, and if I leave the transactions out, only the first query will be executed. Now I know this bug exists: http://bugs.php.net/bug.php?id=28264 And it's virtually identical, except for the fact that I'm passing data through a method first, then executing it (I don't modify the data, as you'll see below). I have come to the conclusion that this is in fact a bug, as I have ruled out every other possibility. PHP Info: http://www.webtrickscentral.com/stuff/phpinfo.php Reproduce code: --------------- http://www.webtrickscentral.com/stuff/phpBug.phps Expected result: ---------------- The code should insert two rows of data into table 'cool'. Actual result: -------------- It does not do anything- no error messages and it does not insert anything. * - This is for any type of query, also. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29806&edit=1