homepage Welcome to WebmasterWorld Guest from 54.167.174.90
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP Code from Database?
- dumb noob question
old_expat

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4230164 posted 8:51 am on Nov 14, 2010 (gmt 0)

First off, I'm a PHP dummy .. and trying to figure out a solution:

Is it possible to query a database for PHP code? And if so, how is that PHP code added to the page?

Basically, I need pages that have


<?php
$id = "unique 6 digit number";
$name = "unique name";
$link = "unique url";
$location = "unique location";
?>


What follows on the page are additional PHP code blocks that present information which is served from a remote server.

My list is about 1,700 lines.

If so, what query syntax do I need to use? It appears that I cannot 'echo' PHP code in the same manner I can 'echo' other data?

 

topr8

WebmasterWorld Senior Member topr8 us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4230164 posted 9:13 am on Nov 14, 2010 (gmt 0)

you need to use eval() which will evaluate your string as php, instead of echoing it

old_expat

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4230164 posted 9:42 am on Nov 14, 2010 (gmt 0)

@topr8 - Thanks, I'll dig into a tutorial. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved