實作練習 (再續)
這個練習跟以下的練習有關 http://www.mysql.tw/2013/04/blog-post.html 這個練習資料庫的建立,以及簡單的用PHP來連結資料庫,然後做資料新增與顯示。 http://www.mysql.tw/2013/04/blog-post_18.html 這個練習直接使用SQL指令的SELECT來篩選需要的資料。 以下是練習的步驟: (1) 為了後續的練習,我們必須先加上有意義的資料到資料表中,所以先把舊資料刪除了。 假設你的資料庫是newdb //使用newdbname資料庫 ~ 紅色請依實際狀況修改 use newdbname ; //顯示裡面有哪些資料表 show tables; //刪除舊的資料 delete from customer; delete from order_body; delete from order_head; delete from product; //插入有意義的資料 ~ customer insert into customer(cus_id, cus_name, cus_address, cus_no) values (1, '…