Solved

storing a function in a DB?

Posted on 2002-07-14
2
199 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now