I figured how to escape the single quotes error. I used the following code
Code:
$vbulletin->input->clean_array_gpc('p', array(
'name' => TYPE_STR,
'category' => TYPE_NOCLEAN,
'contact' => TYPE_STR,
));
$db->query_write("INSERT INTO table (id,name,category,contact) values ('','". $db->escape_string($vbulletin->GPC['name']) ."', '". $db->escape_string($vbulletin->GPC['category']) ."','". $db->escape_string($vbulletin->GPC['contact']) ."')");
eval('print_output("' . fetch_template('testtemplate') . '");');
But i have a problem with the blank lines. For example, contact is actually a textarea where the user can enter blank lines. I need the database to store the <br> as well. When i retrieve the information from the database and print it on html, i want the text to have the same formatting as it had when the user submitted the form.
I hope my question is clear.
Please help me