Lasso Soft Inc. > Home

[get_set_options]

Linkget_set_options
AuthorChris Corwin
CategoryDatabase
Version8.x
LicensePublic Domain
Posted01 Feb 2008
Updated02 Feb 2008
More by this author...

Description

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






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.

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

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft