Reputation: 6207
In my php
script I want to check if a structure of database table has changed. The DESCRIBE TABLE
wont provide enough informations, because it ignores the foreign keys. The SHOW CREATE TABLE
is too much, because auto incremental value also appears here.
Upvotes: 2
Views: 112
Reputation: 96326
The SHOW CREATE TABLE is too much, because auto incremental value also appears here.
Just filter out the auto incremental value with a regexp.
preg_replace('/ AUTO_INCREMENT=[0-9]+ /', ' ', $sql);
Upvotes: 5