このページは2007年 10月 24日, 00:35に更新されました by BrigetteK

MySql

From $1

This library contains functions for displaying data from MySQL databases.  関連リンク: Extension Overview, DekiScript Overview, Extension Demos.

Assembly: mindtouch.deki.services
SID: http://services.mindtouch.com/deki/d.../2007/06/mysql

Configuration:

Before the MySql service can be used, it must be configured with the access information to the database.

Config Key Description
db-server IP/hostname of the MySql server
db-port Optional.  MySql server port (default: 3306)
db-catalog Database catalog name
db-user User name (IMPORTANT: make sure user has read-only access!)
db-password Password for user
db-options Optional.  Custom options string that is passed in when connecting to the database

If you need to configure multiple databases for the same wiki, register this extension once for each database.  Use the following preference to specify a unique namespace value for each registration.  Invoke the service using this value instead of mysql.  For example, if you set namespace=mydb1, you would invoke the service with mydb1.table("...") instead of mysql.table("...").

Preference Description
namespace Specifies a custom namespace (default:  mysql)

Functions:

  1. mysql.table

mysql.table(query : str) : xml

Show results of a SELECT query in a table.

Parameters:

Name Type Description
query
str
SELECT query.

Samples:


Output

To embed a SELECT query that displays a list of all users in the users table:

{{ mysql.table("SELECT user_name as Name, user_email as Email FROM users")  }} 

./MySql1.JPG

 

ファイルサイズ日付添付したユーザ 
 MySql1.JPG
説明なし
11.72 kB2007年 10月 19日, 21:20BrigetteKアクション
コメント(5)
全5件のうち5件のコメントを表示: 全て見る
NOTE: the "dp-catalog" should be "db-catalog". I was getting a failure until I canged the configuration value. I am using the default port, but I assume that should say db as well.
投稿日:2007年 10月 14日, 15:27 ()
Yep, you're correct. I fixed it. Thanks!
投稿日:2007年 10月 15日, 09:04 ()
how difficult would it be to add a function that would push data entered into a form into the mysql database
I would like to have a dynmic table on a wiki page to which data can be added and deleted.
投稿日:2007年 10月 20日, 07:14 ()
can you also post examples of this:

db-options Optional. Custom options string that is passed in when connecting to the database
投稿日:2007年 10月 26日, 17:13 ()
For example, we use commonly the following options string:
pooling=true; Connection Timeout=5; Protocol=socket; Min Pool Size=2; Max Pool Size=50; Connection Reset=false;character set=utf8
投稿日:2007年 10月 26日, 20:18 ()
全5件のうち5件のコメントを表示: 全て見る
あなたはコメントを投稿するには ログイン しなければなりません。