Solved

storing a function in a DB?

Posted on 2002-07-14
2
198 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
Comment Utility
Check out the eval() function in PHP help.
0
 
LVL 2

Author Comment

by:higijj
Comment Utility
Thanks a lot!

I should have know that one :)

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

These days socially coordinated efforts have turned into a critical requirement for enterprises.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

771 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