PDA

View Full Version : help with insert query


harmor19
11-13-2005, 09:33 PM
This non-vb related

How would I insert this into an insert query
eval("\$titles = \"".gettemplate("titles")."\";");

I have tried
$query = mysql_query("INSERT INTO hooks (hook_name, phpcode) VALUES ('index_start', 'eval(\"\$test = \"".gettemplate(\"test\")."\";\");')")or die(mysql_error());

It's taking out some slashes. I'll try this way
eval(\"\$test = \"".gettemplate(\"test\")."\";\");


Edit:
That's the way it looks.


Edit 2: I got it to work
$eval_code = eval("\$test = \"".gettemplate("test")."\";");

$query = mysql_query("INSERT INTO hooks (hook_name, phpcode) VALUES ('index_start', '$eval_code')")or die(mysql_error());