Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

storing a function in a DB?

Posted on 2002-07-14
2
Medium Priority
?
206 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 400 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

916 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