rofl90 Posted March 12, 2008 Share Posted March 12, 2008 Whenevr I take out php from mysql, it doesn't use it, and it's actually viewable in my source!! is this a glitch or what.. Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/ Share on other sites More sharing options...
Psycho Posted March 12, 2008 Share Posted March 12, 2008 No, it is not a glitch. I am assuming you are storing "text" in the form of PHP code in your database and then querying for that code - which is actually "text" not code. You could use the exec() command, but I think there are probably much better solutions than storing PHP code int he database to begin with. Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490247 Share on other sites More sharing options...
rofl90 Posted March 12, 2008 Author Share Posted March 12, 2008 what ways then? Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490248 Share on other sites More sharing options...
Northern Flame Posted March 12, 2008 Share Posted March 12, 2008 well it depends on what exactly you are trying to do.... Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490249 Share on other sites More sharing options...
Psycho Posted March 12, 2008 Share Posted March 12, 2008 what ways then? Keep the code in the php file where it belongs and not in the database. A database is meant for data not code. You have not provided any information concerning the reason for wanting to put code into the database so I cannot provide any meaningful comments. But, the fact that you can't simply take "code" from the database and have it execute should be a clue that it was not built for that purpose. But, like I said you should be able to so it with exec() Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490251 Share on other sites More sharing options...
awpti Posted March 12, 2008 Share Posted March 12, 2008 eval, not exec. Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490257 Share on other sites More sharing options...
Psycho Posted March 12, 2008 Share Posted March 12, 2008 eval, not exec. Ah yes, thanks for the correction. Quote Link to comment https://forums.phpfreaks.com/topic/95750-php-from-mysql/#findComment-490390 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.