Log in

View Full Version : Import php.....



real_estate
07-26-2006, 06:29 AM
Is there a way to import php in a mysql and export it?

Twey
07-26-2006, 07:36 AM
Yes, you can store it as a string then eval() it.

real_estate
07-28-2006, 04:53 AM
Hello Twey,

Hey can u give me an example for the same.

Thanx in advance.

Twey
07-28-2006, 09:03 AM
$code = '<?php echo("Hello!"); ?>';
$code = mysql_real_escape_string($code);
mysql_query('insert into table (code) values ("' . $code . '");');

$row = mysql_fetch_array(mysql_query('select code from table where code="' . $code . '" limit 1;'));
eval($row['code']);