How to run php that is contained in a table?

I have a mysql ‘reports’ table that has a field that holds info of how to format a page (I’m using it with fpdf). How do I make it DO/RUN what is in the cell?
E.g. say one of the fields holds this info:

$pdf->SetMargins(2.54,2.54);
$pdf->SetFont(‘Arial’,‘B’,14);

I can retrieve the info okay, but I don’t know how to make it understand that I want to treat that info as instructions, that I want to Run the info that’s contained in that field.

for example, instead of

$pdf=new PDF();
$pdf->AddPage();
$pdf->SetMargins(2.54,2.54);
$pdf->SetFont(‘Arial’,‘B’,14);

//I want someting like

$pdf=new PDF();
$pdf->AddPage();//getinfo from table
$formatinfo = DLookup(“formatphpinfo”, “reports”, “reportId=200”);
//above is a simple function that selects the field formatphpinto from table reports where reportid = 200, and returns the value. It works okay.
$pdf->$formatinfo;//this line is not correct, I don’t know what to put here, how can I make it now run the info thats contained in $formatinfo?

I appreciate any help!

Sponsor our Newsletter | Privacy Policy | Terms of Service