Jump to content

Storing/running php in mysql


Ell360

Recommended Posts

Hey,

 

I am a bit of a noob at php/mysql and trying to be clever(emphasis on trying).

 

I want to pull some php/html code from a database in mysql, whilst it does display the html, the php does not.

Can this even be done? Is it going to cause me issues later on?

 

[code=php:0]
<?php
    $query = "SELECT * FROM pages";
    $result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)){
$body = $row["body"];
echo $body;
    }?>

[/code]

 

Any help would really be appreciated.

 

Ell

Link to comment
https://forums.phpfreaks.com/topic/213609-storingrunning-php-in-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.