iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 9
0
Modern Web

三十天攻略RESTful API (使用codeigniter3)系列 第 9

[Day 9] 短網址產生器

預計的基本功能:

  • 連線重新導向(301 Redirect)
  • 短網址
  • 除短網址
  • 詢短網址
  • 短網址

今天重點:來開資料表!

(使用MySql)

create table urls
(
    url_id bigint auto_increment, --資料ID
    url_shorten varchar default 10 null, --縮短後的url
    url_dest longtext null --重新導向後的url
);

create unique index urls_url_id_uindex
    on urls (url_id);

create unique index urls_url_shorten_uindex
    on urls (url_shorten);

alter table urls
    add constraint urls_pk
        primary key (url_id);

上一篇
[Day 8] 連接與操作資料庫
下一篇
[Day 10]新增短網址
系列文
三十天攻略RESTful API (使用codeigniter3)15
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言