php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18094 Multiple MySQL Statements per Query
Submitted: 2002-07-01 14:23 UTC Modified: 2002-07-01 14:52 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: hz11 at nyu dot edu Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4.2.1 OS: All
Private report: No CVE-ID: None
 [2002-07-01 14:23 UTC] hz11 at nyu dot edu
I think a valuable addition to the MySQL functionality would be a way to run multiple statements per mysql_query() call. For instance:

mysql_query('CREATE DATABASE mynewdb; CREATE TABLE newtable(id TINYINT NOT NULL);', $mysql_link);

Currently,  I would get a SQL syntax error at the first semicolon.  How would results be handled, from SELECTs, INSERTs, etc?  Maybe an array of results/IDs could be returned, or a result/ID set that is itself an array.

Thank you,

Hans

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-01 14:52 UTC] cynic@php.net
this is not going to happen. the mysql extension in php is just a thin wrapper above the mysql C lib, and that doesn't allow this.

but what is far more important, this is a security measure you get for free.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 19:01:30 2024 UTC