Parse Php files stored in MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
japi
Forum Newbie
Posts: 3
Joined: Mon Sep 03, 2007 12:54 am

Parse Php files stored in MySQL

Post by japi »

Let's say i have this stored in a BLOB or TEXT column on MySQL:

Code: Select all

<html>
     <strong><?php echo("Hello, ") ?></strong>World
</html>
Is there a way to tell PHP to parse the BLOB/TEXT column, so the output looks like:
Hello, World
I mean, is there a way to tell PHP to treat the MySQL column as a file?[/b]
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

VERY tentively speaking, eval().
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
japi
Forum Newbie
Posts: 3
Joined: Mon Sep 03, 2007 12:54 am

yeah... but...

Post by japi »

I thought the same thing, but wen you try to eval() that, it gives you an error aout an "unexpected '<' on line 1 ".
eval() as far as i know works with pure php code, and this is html code with some php tags along the way.
Is there a way to tweak eval()? or is there another way to accomplish this?
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

The user comments on the manual page provide some interesting takes on that problem.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
japi
Forum Newbie
Posts: 3
Joined: Mon Sep 03, 2007 12:54 am

Post by japi »

I swear i've read that thing like a thousans times... :lol:

ok so all i need to do is close the php mode "?>"... i swear it would be a lot harder. Thanks
Post Reply