dreamwest Posted November 16, 2009 Share Posted November 16, 2009 I have some php code snippets stored in my database: <?php echo 'Hello'; ?> How can i select this and execute it?? If not is there an alternative?? $res = mysql_query("select * from code were id =1"); $row= mysql_fetch_assoc($res); $code = $row['code']; //this is the code to be executed Quote Link to comment https://forums.phpfreaks.com/topic/181696-solved-execute-php-from-database/ Share on other sites More sharing options...
trq Posted November 16, 2009 Share Posted November 16, 2009 This is generally a bad design choice but take a look at eval. Quote Link to comment https://forums.phpfreaks.com/topic/181696-solved-execute-php-from-database/#findComment-958302 Share on other sites More sharing options...
dreamwest Posted November 16, 2009 Author Share Posted November 16, 2009 Awesome! Just what i needed Quote Link to comment https://forums.phpfreaks.com/topic/181696-solved-execute-php-from-database/#findComment-958346 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.