info.mailtraq.com > Management > Script Functions A-Z > DBRead() DBRead()Returns the contents of a database field specified by field name, record name and database filename. An empty string is returned if the field does not exist. The database is created if the specified database does not pre-exist.
value := DBRead( database , record , field )
- database
- The name of the database table
- record
- The name of the record in the form of a string. The name is not case sensitive
- field
- The name of the field from which a value is to be retrieved. The field name is not case sensitive
- value
- The string of data extracted from the database. If the field, record or table do not exist, an empty string is returned
// The following searches a database for the sig
// to append to a message, checking first that the
// message sender is local
If(IsUserLocal(MsgGetSender()),
Do(
name := UserOf(MsgGetSender()),
If(DBRecordExists("sigs.mtq", name),
MsgAddLine(DBRead("sigs.mtq", name, "sig")
)
)
) |