NPO法人とはという基本的内容から実際のNPO法人設立まで広くお手伝いいたします。これからNPO法人をお考えの方はオススメ。NPO法人とはNon Profit Organizationの略であり、特定非営利活動法人を指します。法人なので当然に登記され、独立した人格として活動ができるようになります。
prepareQuery() and executeQuery*() give you more power and flexibilty for query execution. You can use them, if you have to do more than one equal query (i.e. adding a list of adresses to a database) or if you want to support different databases, which have different implementations of the SQL standard.
Imagine you want to support two databases with different INSERT syntax:
db1 : INSERT INTO tbl_name ( col1, col2 ... ) VALUES ( expr1, expr2 ... ) db2 : INSERT INTO tbl_name SET col1=expr1, col2=expr2 ... |
|
To use the features above, you have to do two steps. Step one is to prepareQuery the statement and the second is to executeQuery it.
Prepare() has to be called with the generic statement at least once. It returns a handle for the statement.
To create a generic statement is simple. Write the SQL query as usual, i.e.
SELECT surname, name, age FROM person WHERE name = 'name_to_find' AND age < 'age_limit' |
SELECT surname, name, age FROM person WHERE name = ? AND age < ? |
prepareQuery() can handle different types of placeholders or wildcards.
? - (recommended) stands for a scalar
value like strings or numbers, the value will be quoted
depending of the database
|
! - stands for a scalar value and
will inserted into the statement "as is".
|
& - requires an existing filename,
the content of this file will be included into the statement
(i.e. for saving binary data of a graphic file in a database)
|
After preparing the statement, you can execute the query. This means to assign the variables to the prepared statement. To do this, executeQuery() requires two arguments, the statement handle of prepareQuery() and an array with the values to assign. The array has to be numerically ordered. The first entry of the array represents the first wildcard, the second the second wildcard etc. The order is independent from the used wildcard char.
INSERT INTO numbers VALUES( '1', 'one', 'en') INSERT INTO numbers VALUES( '2', 'two', 'to') INSERT INTO numbers VALUES( '3', 'three', 'tre') INSERT INTO numbers VALUES( '4', 'four', 'fire') |
If executeQuery*() fails a MDB_Error, else MDB_OK will returned.
| 前のページ | ホーム | 次のページ |
| Introduction - Sequences | 上に戻る | MDB |
PR NPO法人設立看護師・看護婦・ナース 人材派遣 アルバイト ディレクトリ 会社設立 産業廃棄物収集運搬業許可 風俗営業許可(バー・キャバクラ等)