Jump to content

Grabbing PHP script from MySQL


Omiddy

Recommended Posts

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 : )

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.