I have insert function, this function works fine in other page. It's really weird that when try to debug it I found out that there's a weird big enter space beside the INSERT
Like this
"
INSERT INTO table (`sample`) values ("sample")"
Other pages are working fine without enter space
"INSERT INTO table (`sample`) values ("sample")"
here's my function
function insertData($table_name = '', $postedData = array(), $header = '',
$debug = TRUE)
{
$keys = '';
$values = '';
if(!$table_name || !$postedData) {
exit('missing parameter');
}
if(count($postedData)) {
unset($postedData['insert']);
$sql = "INSERT INTO $table_name " . $this->arrayToQueryString($postedData);
if($debug) {
exit($sql);
}
$statement = $this->connection->prepare($sql);
if($statement->execute()) {
if($header != 'login') {
header('Location: ' . $header);
return TRUE;
}
}
}
return FALSE;
}
Thanks works fine in my Localhost but when I transferred it in cpanel server got this problem