createSequence() in mysql.php

From: Date: Mon, 18 Dec 2000 00:20:49 +0000
Subject: createSequence() in mysql.php
Groups: php.pear 
Request: Send a blank email to php-pear+get-711@lists.php.net to get a copy of this message
Hello, just wanted to say that the 'id' column in sequence tables should be declared NOT NULL to work in MySQL 3.22. Besides this, tables are more compact and efficient being declared this way. function createSequence($seq_name) { $sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name); return $this->query("CREATE TABLE ${sqn}_seq ". "(id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY(id))"); } -- Stay tuned, MhZ mailto:mookid@sigent.ru ----------- "An entire fraternity of strapping Wall-Street-bound youth. Hell - this is going to be a blood bath!" -- Post Bros. Comics

« previous php.pear (#711) next »