- 12月 02 週五 201122:49
清單
- 9月 03 週五 201000:37
LINUX|E: Could not get lock /var/cache/apt/archives/lock - open (11 Resource temporarily unavailable)
root@trainer:/var/lib# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
The following packages were automatically installed and are no longer required:
mysql-client
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
2 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
The following packages were automatically installed and are no longer required:
mysql-client
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
2 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
- 5月 10 週一 201008:57
php|自動轉向頁面有兩種寫法
自動轉向有兩種寫法如下:
<META HTTP-EQUIV='refresh' CONTENT='秒數; URL=網址'>
現在在a網頁 然後現在要跳到c網頁去 可是送出a網頁其實應該是跳到b網頁
<META HTTP-EQUIV='refresh' CONTENT='秒數; URL=網址'>
現在在a網頁 然後現在要跳到c網頁去 可是送出a網頁其實應該是跳到b網頁
- 4月 17 週六 201022:37
軟體|Gantt Project,甘特圖的好幫手
官方載點:http://www.ganttproject.biz/
免安裝中文版:http://azo-freeware.blogspot.com/2008/01/ganttproject-206.html
- 3月 22 週一 201014:05
筆記|只是怕會忘記的論壇筆記
管理員控制台(ACP) → 發表 → 附加檔案的"管理副檔名群組"
→ 選擇 Documents 後面的編輯圖示 → 勾選"允許" → 送出。
- 1月 05 週二 201013:18
CSS|基本語法大全
在<head></head>裡面寫CSS的樣式宣告
<style type="text/css">
<style/>
之後再到<body></body>裡面應用樣式
<style type="text/css">
<style/>
之後再到<body></body>裡面應用樣式
- 1月 02 週六 201015:45
比較|WAMP比較(AppServ、XAMPP和Apache2TRIAD)
Apache
最多人使用三大WAMP安裝模組:
AppServ:http://www.appservnetwork.com/
輕巧的WAMP套件(只裝重要的程式部分),把一些知名的CMS包成套件給我們選用
如果只是要跑小論壇可以安裝這個即可,電腦負擔較小
所以大部分我都用此建立php環境!
最多人使用三大WAMP安裝模組:
AppServ:http://www.appservnetwork.com/
輕巧的WAMP套件(只裝重要的程式部分),把一些知名的CMS包成套件給我們選用
如果只是要跑小論壇可以安裝這個即可,電腦負擔較小
所以大部分我都用此建立php環境!
- 12月 18 週五 200919:27
PHP|html表格呈現 同下
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>testing</title>
</head>
<body>
<?php
/*
* 建立資料庫
* CREATE DATABASE `kiang_cycu` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
*
* 建立資料表
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poster` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
*/
/*
* 資料庫連線
*/
$dbn = new mysqli(
'localhost', //主機位置
'root', //帳號
'123', //密碼
'guestbook' //資料庫名稱
);
$dbn->set_charset('utf8');
/*
* 新增資料
*/
if($dbn->query('SELECT COUNT(*) AS count FROM messages')->fetch_object()->count == 0) {
$now = mktime();
for($i = 1; $i <= 20; $i++) {
$stmt = $dbn->prepare('INSERT INTO messages VALUES ( ?, ?, ?, ?)');
$poster = 'poster' . $i;
$title = 'title' . $i;
$body = 'body' . $i;
$date = date('Y-m-d H:i:s', ++$now);
$stmt->bind_param('ssss', $poster, $title, $body, $date);
$stmt->execute();
$stmt->close();
}
}
/*
* 取得資料
*/
echo '<table>';
echo '<tr><th>編號</th><th>發表人</th><th>標題</th><th>內容</th><th>時間</th></tr>';
$result = $dbn->query('SELECT * FROM messages');
while($data = $result->fetch_object()) {
echo '<tr>';
echo '<td>' . $data->id . '</td>';
echo '<td>' . $data->poster . '</td>';
echo '<td>' . $data->title . '</td>';
echo '<td>' . $data->body . '</td>';
echo '<td>' . $data->time . '</td>';
echo '</tr>';
}
echo '</table>';
?>
</body>
</html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>testing</title>
</head>
<body>
<?php
/*
* 建立資料庫
* CREATE DATABASE `kiang_cycu` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
*
* 建立資料表
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poster` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
*/
/*
* 資料庫連線
*/
$dbn = new mysqli(
'localhost', //主機位置
'root', //帳號
'123', //密碼
'guestbook' //資料庫名稱
);
$dbn->set_charset('utf8');
/*
* 新增資料
*/
if($dbn->query('SELECT COUNT(*) AS count FROM messages')->fetch_object()->count == 0) {
$now = mktime();
for($i = 1; $i <= 20; $i++) {
$stmt = $dbn->prepare('INSERT INTO messages VALUES ( ?, ?, ?, ?)');
$poster = 'poster' . $i;
$title = 'title' . $i;
$body = 'body' . $i;
$date = date('Y-m-d H:i:s', ++$now);
$stmt->bind_param('ssss', $poster, $title, $body, $date);
$stmt->execute();
$stmt->close();
}
}
/*
* 取得資料
*/
echo '<table>';
echo '<tr><th>編號</th><th>發表人</th><th>標題</th><th>內容</th><th>時間</th></tr>';
$result = $dbn->query('SELECT * FROM messages');
while($data = $result->fetch_object()) {
echo '<tr>';
echo '<td>' . $data->id . '</td>';
echo '<td>' . $data->poster . '</td>';
echo '<td>' . $data->title . '</td>';
echo '<td>' . $data->body . '</td>';
echo '<td>' . $data->time . '</td>';
echo '</tr>';
}
echo '</table>';
?>
</body>
</html>
- 12月 18 週五 200919:27
PHP|資料庫連線 新增資料 取得資料
<?php
/*
* 建立資料庫
* CREATE DATABASE `kiang_cycu` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
*
* 建立資料表
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poster` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
*/
/*
* 資料庫連線
*/
$dbn = new mysqli(
'localhost', //主機位置
'root', //帳號
'123', //密碼
'guestbook' //資料庫名稱
);
$dbn->set_charset('utf8');//設定資料庫連線編碼 中文可以完整顯示
//物件裡面的函式->方法(set_charset)
/*
* 新增資料
*/
//從資料庫查詢有多少數量 [!!!]判斷資料庫裡驗有沒有資料 如果"沒有"
if($dbn->query('SELECT COUNT(*) AS count FROM messages') ->fetch_object()->count == 0) {//資料表
$now = mktime();
for($i = 1; $i <= 20; $i++) {//[!!!]沒有資料的話 就塞20筆進去
//prepare 資料庫從使用者過來 先設定統一為字串格式
$stmt = $dbn->prepare('INSERT INTO messages VALUES (NULL, ?, ?, ?, ?)');
$poster = 'poster' . $i;
$title = 'title' . $i;
$body = 'body' . $i;
$date = date('Y-m-d H:i:s', ++$now);
//ssss 代表????都為字串格式 (不管是數字或是字串 都把他存成字串格式)
$stmt->bind_param('ssss', $poster, $title, $body, $date);
$stmt->execute();
$stmt->close();
}
}
/*
* 取得資料
*/
$result = $dbn->query('SELECT * FROM messages');//取所有資料
while($data = $result->fetch_object()) {
echo '<pre>';
print_r($data);//印出資料庫所有資料
echo '</pre>';
}
/*
* 建立資料庫
* CREATE DATABASE `kiang_cycu` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
*
* 建立資料表
CREATE TABLE IF NOT EXISTS `messages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poster` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
*/
/*
* 資料庫連線
*/
$dbn = new mysqli(
'localhost', //主機位置
'root', //帳號
'123', //密碼
'guestbook' //資料庫名稱
);
$dbn->set_charset('utf8');//設定資料庫連線編碼 中文可以完整顯示
//物件裡面的函式->方法(set_charset)
/*
* 新增資料
*/
//從資料庫查詢有多少數量 [!!!]判斷資料庫裡驗有沒有資料 如果"沒有"
if($dbn->query('SELECT COUNT(*) AS count FROM messages') ->fetch_object()->count == 0) {//資料表
$now = mktime();
for($i = 1; $i <= 20; $i++) {//[!!!]沒有資料的話 就塞20筆進去
//prepare 資料庫從使用者過來 先設定統一為字串格式
$stmt = $dbn->prepare('INSERT INTO messages VALUES (NULL, ?, ?, ?, ?)');
$poster = 'poster' . $i;
$title = 'title' . $i;
$body = 'body' . $i;
$date = date('Y-m-d H:i:s', ++$now);
//ssss 代表????都為字串格式 (不管是數字或是字串 都把他存成字串格式)
$stmt->bind_param('ssss', $poster, $title, $body, $date);
$stmt->execute();
$stmt->close();
}
}
/*
* 取得資料
*/
$result = $dbn->query('SELECT * FROM messages');//取所有資料
while($data = $result->fetch_object()) {
echo '<pre>';
print_r($data);//印出資料庫所有資料
echo '</pre>';
}
- 12月 16 週三 200917:12
筆記|PHP網頁之間資料的傳遞
【網頁之間資料的傳遞 不同的傳遞方式】
1.http-> 表單post方法
2.URL-> 表單get方法
1.http-> 表單post方法
2.URL-> 表單get方法