[get_set_options]

Description

Link: [get_set_options]
Author: Chris Corwin
Category: Database
Version: 8.x
License: Public Domain
Posted: Feb. 01, 2008
Updated: Feb. 02, 2008
More by this author...

Returns an array of the possible values for a SET Requires 'table' and 'column' output is like: array: ('Show'), ('Hide'), ('Deleted')






Parameters

-table string, required Name of the table from which you are retrieving a value.
-column string, required Name of the column from which you are reading the possible options.

Sample Usage

get_set_options('Table_Name', 'Column_Name');
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
define_tag(
	'get_set_options', 
	-required='table', 
	-required='column', 
	-priority='replace'
	);
		local('sql' = 'SHOW COLUMNS FROM ' #table ' LIKE "'#column'"');
		inline(
			$connection_db, 
			-table=#table, 
			-sql=#sql
			);
				rows;
					return(column('Type')->
						substring(
								5, 
								(column('Type')->length - 5)
							)->split(',')
						);
				/rows;
		/inline;
/define_tag;

 

Comments

none

Email:


Password:



Newest

Most Popular