这是我的代码:
-- Add new FK column
ALTER TABLE FKTable ADD currencyCode char(3)
CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
-- Map FK column to the new Primary Key
UPDATE FKTable
SET currencyCode = (SELECT `code` FROM currency WHERE id = FKTable.currencyId);
-- Drop the old foreign key + column
ALTER TABLE FKTable DROP FOREIGN KEY FKTable_Currency;
ALTER TABLE FKTable DROP COLUMN currencyId;
-- Once the above is done for all FK tables, drop the PK on currency
ALTER TABLE `currency` CHANGE COLUMN `id` `id` INT(11) NOT NULL,
DROP PRIMARY KEY;
ALTER TABLE currency ADD PRIMARY KEY (`code`);
ALTER TABLE FKTable ADD CONSTRAINT FKTable_Currency2
FOREIGN KEY (currencyCode) REFERENCES currency(`code`);
即。是页面$patt = "#href=\"(.*?)\"#";
preg_match($patt,$data,$match);
echo $match[1];`
$data
我想抓住上面这个链接。感谢