Solved

storing a function in a DB?

Posted on 2002-07-14
2
201 Views
Last Modified: 2006-11-17
is it possible to do something like storing the function's body into a DB ?

so everyting my phpscript runs, it grabs the code from the DB?

cuz I have to construct querystring for so my script submit to differents forms on the web but not all form takes the same input and/or in a different way.

example: state, some will use the 2 letters code while other will take the full name
or date, some will have one field for date, while other may have a field for day, month and year.

so basically, I would do concatenation and other basic operation so it sends out the correct query string.

For each form, I would store the correct function into my DB.

The problem I see, is once I do something like
$sql = "SELECT * FROM myTable WHERE ID=1";

$result = ExecuteQuery($sql);

$result will contain the correct code.. but how can I RUN this code as a function?

Thanks
0
Comment
Question by:higijj
2 Comments
 
LVL 5

Accepted Solution

by:
Hamlet081299 earned 100 total points
ID: 7153042
Check out the eval() function in PHP help.
0
 
LVL 2

Author Comment

by:higijj
ID: 7153325
Thanks a lot!

I should have know that one :)

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question