[PHP] Executing the value of a variable
I would like to store some code in a database and load/execute that code based on a query. Is it possible to execute the value of a variable in a php script? I am aware of several other ways to accomplish the same task, but I just want to see if there is in fact a performance hit from storing code in a database. I tried something along the line of: while ($row = mysql_fetch_array($result) { function loaded_module() {$row[moduleCode];} } loaded_module(); but that doesn't seem to work. Any thoughts? -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Executing the value of a variable
www.php.net/exec Make sure you read the entire page and are aware of the security concerns of using this function. ---John Holmes... -Original Message- From: Jackson Miller [mailto:anything;jaxn.org] Sent: Saturday, November 02, 2002 8:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Executing the value of a variable I would like to store some code in a database and load/execute that code based on a query. Is it possible to execute the value of a variable in a php script? I am aware of several other ways to accomplish the same task, but I just want to see if there is in fact a performance hit from storing code in a database. I tried something along the line of: while ($row = mysql_fetch_array($result) { function loaded_module() {$row[moduleCode];} } loaded_module(); but that doesn't seem to work. Any thoughts? -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Executing the value of a variable
You want to look at eval(); Jackson Miller wrote: I would like to store some code in a database and load/execute that code based on a query. Is it possible to execute the value of a variable in a php script? I am aware of several other ways to accomplish the same task, but I just want to see if there is in fact a performance hit from storing code in a database. I tried something along the line of: while ($row = mysql_fetch_array($result) { function loaded_module() {$row[moduleCode];} } loaded_module(); but that doesn't seem to work. Any thoughts? -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Executing the value of a variable
eval() - Original Message - From: Jackson Miller [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 02, 2002 7:02 AM Subject: [PHP] Executing the value of a variable I would like to store some code in a database and load/execute that code based on a query. Is it possible to execute the value of a variable in a php script? I am aware of several other ways to accomplish the same task, but I just want to see if there is in fact a performance hit from storing code in a database. I tried something along the line of: while ($row = mysql_fetch_array($result) { function loaded_module() {$row[moduleCode];} } loaded_module(); but that doesn't seem to work. Any thoughts? -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Executing the value of a variable
www.php.net/eval I mean... duh! sorry... ---John Holmes... -Original Message- From: John W. Holmes [mailto:holmes072000;charter.net] Sent: Saturday, November 02, 2002 9:24 AM To: 'Jackson Miller'; [EMAIL PROTECTED] Subject: RE: [PHP] Executing the value of a variable www.php.net/exec Make sure you read the entire page and are aware of the security concerns of using this function. ---John Holmes... -Original Message- From: Jackson Miller [mailto:anything;jaxn.org] Sent: Saturday, November 02, 2002 8:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Executing the value of a variable I would like to store some code in a database and load/execute that code based on a query. Is it possible to execute the value of a variable in a php script? I am aware of several other ways to accomplish the same task, but I just want to see if there is in fact a performance hit from storing code in a database. I tried something along the line of: while ($row = mysql_fetch_array($result) { function loaded_module() {$row[moduleCode];} } loaded_module(); but that doesn't seem to work. Any thoughts? -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php