Re: createSequence() in mysql.php
| From: | Colin Viebrock | Date: | Mon, 18 Dec 2000 04:20:17 +0000 |
| Subject: | Re: createSequence() in mysql.php | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-712@lists.php.net to get a copy of this message | ||
[Mon, 18 Dec 2000] Mikhail Zabaluev said:
> 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))");
> }
Make that an unsigned integer too, no?
- Colin