EXECPHP()

From Lianjapedia
Revision as of 07:56, 11 January 2013 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Purpose

Function to run multiple lines of PHP code

Syntax

EXECPHP(<expC>)

See Also

COMPILE, EXEC(), EXECJAVASCRIPT(), EXECPYTHON(), EXECSCRIPT()

Description

The EXECPHP() function runs multiple lines of PHP code. The lines of code are contained in <expC>, which can be a text constant, a character variable, or a character or memo field. The EXECPHP() function can handle blocks of code. Individual lines of code must be separated by a CHR(13) carriage return character.

Example

create table if not exists scripts (script char(200))
if not used("scripts")
	use scripts
endif
select scripts
append blank
replace script with 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;';
+ CHR(13) + '}' + CHR(13)
execphp(script)
 
// Text constant
execphp('for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;';
+ CHR(13) + '}' + CHR(13))
 
// Memory variable
m_script = 'for ($i = 1; $i <= 10; $i++) {' + CHR(13) + '// process commands;';
+ CHR(13) + '}' + CHR(13)
execphp(m_script)