使用improv3d連接到sql登入 Topic is solved

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

be90728

使用improv3d連接到sql登入  Topic is solved

26 Sep 2016, 03:00

請教各位大神,我目前這邊已經有了
執行的腳本、improv3d.ahk、我也在php服務器上放置了設定過的improv3d-0.1.php,也設定好了資料庫
improv3d.ahk伺服器位置我也改成我的php伺服器
想問我基礎工作都做好了,那我要如何在腳本中放執行碼?(原官網沒有教學,我也嘗試過去其他論壇找,但是都是有一些問題的...)

improv3d.ahk的內容如下

Code: Select all

#NoEnv
/*                               
*
*	Dokumentation: 	http://api.cali-kartell.de
*
* 	Functions:
*	imp_read(row, column)
*	imp_write(row, column, value)
*	imp_create_row(name)
*	imp_delete_row(name)
*	imp_list_rows()
*	imp_row_exist(row)
*	imp_add_column(column)
*	imp_delete_column(column)
*	imp_rename_column(row, newname)
*	imp_create_table(rows)
*	imp_delete_table(table)
*	imp_list_table()
*/

	;Die Adresse ihres Servers bzw. das Verzeichniss in dem die improv3d-0.1.php liegt.
	server := "http://www.lgolegends.com/overwatch.php"

	/*
	*	Der Zugriff auf die Datenbank kann mit einer PIN gesichert werden.
	*	Die PIN muss mit der in der improv3d-0.1.php angegebenen PIN übereinstimmen und darf nur aus Zahlen bestehen.
	*	Ist in der improv3d-0.1.php Pin mit 0 definiert, wird kein PIN genutzt.
	*/
	pin := 0

;-------------------------------------------------------------------------------------------
imp_read(row, column) {
	global server
	query := server "?action=read&row=" row "&column=" column imp_secure()
	return imp_query(query)
}

imp_write(row, column, value) {
	global server
	query := server "?action=write&row=" row "&column=" column "&value=" value imp_secure()
	return imp_query(query)
}

imp_create_row(row) {
	global server
	query := server "?action=create_row&row=" row imp_secure()
	urlDownloadToFile, %query%, response.tmp
	FileRead, response, response.tmp
	FileDelete, response.tmp
	if(response)
		return response
	else
		return false
}

imp_delete_row(row) {
	global server
	query := server "?action=delete_row&row=" row imp_secure()
	return imp_query(query)
}

imp_create_table(columns) {
	global server
	query := server "?action=create_table&columns=" columns imp_secure()
	return imp_query(query)
}

imp_delete_table() {
	global server
	query := server "?action=delete_table" imp_secure()
	return imp_query(query)
}

imp_list_columns() {
	global server
	query := server "?action=list_columns" imp_secure()
	return imp_query(query)
}

imp_list_rows() {
	global server
	query := server "?action=list_rows" imp_secure()
	return imp_query(query)
}

imp_add_column(column) {
	global server
	query := server "?action=add_column&column=" column imp_secure()
	return imp_query(query)
}

imp_delete_column(column) {
	global server
	query := server "?action=delete_column&column=" column imp_secure()
	return imp_query(query)
}

imp_rename_column(column, newname) {
	global server
	query := server "?action=rename_column&column=" column "&newname=" newname imp_secure()
	return imp_query(query)
}

imp_row_exist(row) {
	global server
	query := server "?action=row_exist&row=" row imp_secure()
	if(imp_query(query))
		return 1
	else 
		return 0
}

imp_query(query) {
	urlDownloadToFile, %query%, response.tmp
	FileRead, response, response.tmp
	FileDelete, response.tmp
	if(response)
		return response
	else
		return false
}

imp_secure() {
	global pin
	if(pin > 0)
		return "&key=" round(A_Hour * pin, 4)
}

而improv3d-0.1.php的重要內容如下

Code: Select all

	**************************************************************/
	$server 	= "localhost";
	$database 	= "資料庫名稱";
	$table 		= "user";
	$user 		= "資料庫用戶";
	$password 	= "資料庫密碼";
	
	/*************************************************************
我是下載最新的improv3d使用

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 7 guests