Im new to PHP/MYSQL so im sry if you feel this is a bad question but i cant get this to work. Its for a login form. The issue i have is with the insert into with the insert query part. I apreciate if anyone could help me get this fixed :) TY in advance.
function InsertIntoDB(&$formvars)
{
$confirmcode = $this->MakeConfirmationMd5($formvars['email']);
$formvars['confirmcode'] = $confirmcode;
$insert_query = 'insert into '.$this->tablename.'(
name,
email,
username,
password,
confirmcode
)
values
(
"' . $this->SanitizeForSQL($formvars['name']) . '",
"' . $this->SanitizeForSQL($formvars['email']) . '",
"' . $this->SanitizeForSQL($formvars['username']) . '",
"' . md5($formvars['password']) . '",
"' . $confirmcode . '"
)';
if(!mysqli_query( $this->connection, $insert_query ))
{
$this->HandleDBError("Error inserting data to the table
query:$insert_query");
return false;
}
return true;
}