FrEaKmAn
August 8th, 2006, 10:12 AM
Hi
I would like to add php code into mysql database. I found one tutorial but I can't get it to work. This is the code
<?php
include 'config.php';
$result = mysql_query("SELECT * FROM test");
list($text) = mysql_fetch_array($result);
/*$text = '<?php include "1.php"; ?>';*/
eval('?>'.$text.'<?php');
?>
and mysql data
CREATE TABLE `test` (
`text` longtext
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `test` (`text`) VALUES ('<?php include \\"1.php\\"; ?>');
and I get this error
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...index.php(10) : eval()'d code on line 1
Parse error: parse error, unexpected $end in ...index.php(10) : eval()'d code on line 1
I would like to add php code into mysql database. I found one tutorial but I can't get it to work. This is the code
<?php
include 'config.php';
$result = mysql_query("SELECT * FROM test");
list($text) = mysql_fetch_array($result);
/*$text = '<?php include "1.php"; ?>';*/
eval('?>'.$text.'<?php');
?>
and mysql data
CREATE TABLE `test` (
`text` longtext
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `test` (`text`) VALUES ('<?php include \\"1.php\\"; ?>');
and I get this error
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ...index.php(10) : eval()'d code on line 1
Parse error: parse error, unexpected $end in ...index.php(10) : eval()'d code on line 1