|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-03-26 08:01 UTC] sander@php.net
[2002-03-26 08:45 UTC] hholzgra@php.net
[2002-12-07 01:52 UTC] iliaa@php.net
[2002-12-23 01:00 UTC] php-bugs at lists dot php dot net
[2005-11-01 07:42 UTC] nicked at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 12:00:01 2025 UTC |
I am creating tables and indexes in a few places. To make life a little easier I want to create a table and it's indexes in one go. The following code fails: ---- $queries[0]["query_string"]="CREATE TABLE objects ( [id] integer IDENTITY (1,1) PRIMARY KEY, [type] varchar(16) DEFAULT '' NOT NULL, [object] text, [vtype] varchar(16) DEFAULT '' NOT NULL, [lastchanged] TIMESTAMP); CREATE INDEX objects_lastchanged ON objects (lastchanged);"; $queries[1]["query_string"]="CREATE TABLE nodes ( path varchar(127) DEFAULT '' NOT NULL PRIMARY KEY, parent varchar(127) DEFAULT '' NOT NULL, object numeric(11) DEFAULT '0' NOT NULL, priority numeric(11) DEFAULT '0' NOT NULL );"; while ((list($key, $query)=each($queries)) && (!$error)) { echo $query["query_string"]; $exec=mssql_query($query["query_string"]); } ---- But if I separate out the create index into a separate query it works fine.