CodeChargeStudio : DataBase Error: Cannot connect to database MySQL
Databse Halted.
Database error: cannot connect to Database
MySQL Error
Session halted.
上兩周原本是Win7 的電腦被自動更新為 Win 10,原本擔心一些舊的AP不知道是否可以正常運作,例如CodeCharge等,結果試試,似乎還好。
前天,將原本舊的一個專案,原本運作都正常,就做了一些更新後,就上傳了。結果,產生了上述的錯誤!
搞了一整天,查不出原因。
後來,逐一比對 db_mysql.php 這檔案才發現,我不知道為什麼 db_mysql.php 是舊的,應該是 php 5.5以後,一些舊的 指令已經不能用了,mysql_pconnect() 必須改成:mysqli_connect() 等等。
手動的ftp方式,將新的 db_mysql.php 更新到伺服器上,就正常了!
註記在這裡。
註:
不是:是新的改成 mysqli_connect() 就不行了!
舊的可以!
將 舊的 db_mysql.php 改回去,蓋掉新的 db_mysql.php 就正常了!
本網誌記錄網站設計的一些內容筆記。 網站設計需要整合很多工具與概念。 我畢業自淡江電子計算機科學學系,算是科班出身。但我們那個年代(50年代,唉!LKK了!),網路還只是剛開始,相關的技術都是出社會以後陸續接觸學習。 網站的建立與設計,牽涉的範圍真的很廣泛。 網站的目地是甚麼?銷售網頁、電子購物、廣告、社群經營、互動、教學、客戶服務、網站應用程式、...... 需要整合的人才,程式設計師、資料庫管理師、網頁美編、文字編輯、多媒體製作等等。 這裡將記錄一個LKK對網站系統重新學習與複習,還有教學使用的一些資料。
2016年6月11日 星期六
2016年4月1日 星期五
CodeCharge Studio的 DateTime format
Code Charge 有他自己的 DateTime 格式,不同於 MySql 與 php,所以,從mySql 中讀出來的日期資料,如果用 php程式處理,需要使用 CCS 提供的函數:
CCFormatDate Function (PHP)
CCParseDate Function (PHP)
2016年1月23日 星期六
codecharge 設計一個grid 後面,不同的按鈕形狀
想要設計一個效果:在Grid 資料表裡面,每一筆記錄,因為資料狀泰不同,而有不同的按鈕。
按鈕是一個連結到另一個網頁,伴隨著一些連結參數。
原本使用Code Charge 的 Link Control,然後在該Grid 的 BeforeShowRow Event 中進行設定:
$grids->link1->SetValue("some thing");
結果發現,都失敗了!連結的文字,跟本都不理我。
後來,看了 CCS的 help 檔案,裡面有一個範例是這樣的:
<a href="{label1}?parameter={label2}">{label3}</a>
也就是根本就捨棄使用CCS內的 Link Control,而是使用html,裡面的一些設定,完全自己使用label來控制。這引發我很多想法。
Bootstarp 裡面,可以有很多現成的可以使用效果:
<a href=.....> 也可以使用 class="btn btn-primary",這樣一來,Link也有按鈕的效果。
class="btn btn-primary disabled" 就可以使該連結失效!
而這些值都可以在
BeforeShowRow Event 中依據需要而自由設定。
這樣就解決問題了!
按鈕是一個連結到另一個網頁,伴隨著一些連結參數。
原本使用Code Charge 的 Link Control,然後在該Grid 的 BeforeShowRow Event 中進行設定:
$grids->link1->SetValue("some thing");
結果發現,都失敗了!連結的文字,跟本都不理我。
後來,看了 CCS的 help 檔案,裡面有一個範例是這樣的:
<a href="{label1}?parameter={label2}">{label3}</a>
也就是根本就捨棄使用CCS內的 Link Control,而是使用html,裡面的一些設定,完全自己使用label來控制。這引發我很多想法。
Bootstarp 裡面,可以有很多現成的可以使用效果:
<a href=.....> 也可以使用 class="btn btn-primary",這樣一來,Link也有按鈕的效果。
class="btn btn-primary disabled" 就可以使該連結失效!
而這些值都可以在
BeforeShowRow Event 中依據需要而自由設定。
這樣就解決問題了!
2016年1月12日 星期二
CodeChargeStudio!!! button onclick bug!?
設計了一個 record form,裡面有 button ,
可是為什麼設計了一個 on-click event,卻抓不到該筆 records 的欄位?
奇怪?!
可是為什麼設計了一個 on-click event,卻抓不到該筆 records 的欄位?
奇怪?!
2015年12月21日 星期一
2015年12月19日 星期六
jQuery AJAX
jQuery AJAX Methods
AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page.
The following table lists all the jQuery AJAX methods:
| Method | Description |
|---|---|
| $.ajax() | Performs an async AJAX request |
| $.ajaxPrefilter() | Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax() |
| $.ajaxSetup() | Sets the default values for future AJAX requests |
| $.ajaxTransport() | Creates an object that handles the actual transmission of Ajax data |
| $.get() | Loads data from a server using an AJAX HTTP GET request |
| $.getJSON() | Loads JSON-encoded data from a server using a HTTP GET request |
| $.getScript() | Loads (and executes) a JavaScript from a server using an AJAX HTTP GET request |
| $.param() | Creates a serialized representation of an array or object (can be used as URL query string for AJAX requests) |
| $.post() | Loads data from a server using an AJAX HTTP POST request |
| ajaxComplete() | Specifies a function to run when the AJAX request completes |
| ajaxError() | Specifies a function to run when the AJAX request completes with an error |
| ajaxSend() | Specifies a function to run before the AJAX request is sent |
| ajaxStart() | Specifies a function to run when the first AJAX request begins |
| ajaxStop() | Specifies a function to run when all AJAX requests have completed |
| ajaxSuccess() | Specifies a function to run when an AJAX request completes successfully |
| load() | Loads data from a server and puts the returned data into the selected element |
| serialize() | Encodes a set of form elements as a string for submission |
| serializeArray() | Encodes a set of form elements as an array of names and values |
AJAX
AJAX 概念:

Create an XMLHttpRequest Object
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
// code for IE6, IE5 xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
Send a Request To a Server
Server Response
The onreadystatechange Event
<!DOCTYPE html>
<html>
<body>
<h3>Start typing a name in the input field below:</h3>
<form action="">
First name: <input type="text" id="txt1" onkeyup="showHint(this.value)">
</form>
<p>Suggestions: <span id="txtHint"></span></p>
<script>
function showHint(str) {
var xhttp;
if (str.length == 0) {
document.getElementById("txtHint").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "gethint.php?q="+str, true);
xhttp.send();
}
</script>
</body>
</html>
showCustomer
function showCustomer(str) {
var xhttp;
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xhttp.responseText;
}
};
xhttp.open("GET", "getcustomer.asp?q="+str, true);
xhttp.send();
}
訂閱:
文章 (Atom)
如何判斷現在FORM是在 insert mode? 還是 update mode?
只要用 if (empty({primary_key})) 就可以知道是否為新增模式了。 如果 {promary_key} 是空白的,那麼就是在新增模式;反之,就是更新模式。 以上。
-
3-1 使用 Smarty 一、Smarty基本操作 大原則:和外觀有關的東西都放到.html或.tpl中,所需要的資料全由.php提供,簡單範例,index.php內容: <?php require_once 'smarty/lib...
-
分享:網站上 http://shuai.be/archives/php-undefined-index/ 平時用 $_GET[ ‘ xx ’ ] 取得參數值時,如果之前不加判斷在未傳進參數時會出現這樣的警告 : PHP Notice: undefined i...
-
【PHP】下載檔案但不直接開啟 多數人在下載檔案的頁面直接連結該檔案, 如下寫法 ---- a href="檔名.副檔名" 這在 windows 系統會有一個可能的狀況, 當此類型檔案與 windows 預設開啟功能...