Omiddy Posted September 3, 2010 Share Posted September 3, 2010 Hello, I'm new to this website so forgive me if I'm posting in the wrong section. I just need to know if there is a way that I can retrieve php script that is stored in a database? for example, in my database in table: <? echo"Hello World"; ?> and in my php file, I call that using: <? mysql_connect("asdas","asdas","asd"); mysql_select_db("asdasda"); $result = mysql_query("select * from somedatabse"); while($r=mysql_fetch_array($result)) { $table=$r["table"]; } echo"$table"; ?> i know its confusing, i just hope i made sense and that someone understands what im trying to do. any help will be appreciatedddd thank you : ) Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/ Share on other sites More sharing options...
Omiddy Posted September 3, 2010 Author Share Posted September 3, 2010 nvm, I got it ... just used: <?php eval('?>' . $table. '<?php '); ?> ' Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106739 Share on other sites More sharing options...
trq Posted September 3, 2010 Share Posted September 3, 2010 I understand what your trying to do, just not why your trying to do it. If you really think you need to store script in your database there is something else wrong with the design of your application. Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106740 Share on other sites More sharing options...
Omiddy Posted September 3, 2010 Author Share Posted September 3, 2010 I'm trying to have a single web layout and have all the content pulled from the database .. this way i can make an admin panel and ill be able to edit the content from anywhere .. not sure if its the wisest idea, but its the only one i could come up with ... :S what do you think? Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106741 Share on other sites More sharing options...
Omiddy Posted September 3, 2010 Author Share Posted September 3, 2010 yea, i actually dont know why im doing this .. :S Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106742 Share on other sites More sharing options...
trq Posted September 3, 2010 Share Posted September 3, 2010 I'm trying to have a single web layout and have all the content pulled from the database .. PHP is not content. Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106743 Share on other sites More sharing options...
Onloac Posted September 3, 2010 Share Posted September 3, 2010 yeah. You better research a little more before you jump into things like this. You'll want all your content, settings, user info in the database. Start simple... make something that adds text through a text box. Once you have it successfully do that, go onto making a page to pull the content from the database and display it. Just keep in mind, if your site gets big people will start to test your skills as a programmer. I'm still in the process of learning myself but I've learned its always good to cover your back. Make sure you keep in mind that just because you don't want someone to do something doesn't me they wont. Just read up on a couple tutorials use their code to base your script off of... then once you learn more you can eventually replace it with something of your own. Quote Link to comment https://forums.phpfreaks.com/topic/212420-grabbing-php-script-from-mysql/#findComment-1106756 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.