Issue while inserting record in table

//Insert Stat Information...

$phql = "INSERT into TlbStatSampleDownload(first_name,last_name,company_name,email_address,phone_number,tech_name,tech_slug,downloaded_date,tech_type,tech_type_value,reff_url)values('".addslashes($this->request->getPost('FirstName'))."',
'".addslashes($this->request->getPost('LastName'))."',
'".addslashes($this->request->getPost('companyname'))."',
'".addslashes($this->request->getPost('emailaddress'))."',
'".addslashes($this->request->getPost('phonenumber'))."',
'".addslashes($this->request->getPost('tech_name'))."',
'".addslashes($this->request->getPost('tech_slug'))."',
now(),
'".addslashes($this->request->getPost('payment_tech_type'))."',
'".addslashes($this->request->getPost('payment_tech_name'))."',
'".addslashes($this->request->getPost('pagefrom'))."')";
$success = $this->modelsManager->executeQuery($phql);

Above Query is not working..



84.5k

Are you getting an error or something?



5.5k

No sir I am not getting any such error..



5.5k
edited Sep '14

Even i f i write this sql on my view page its not working.

$phql = "INSERT into TlbStatSampleDownload(first_name,last_name,company_name,email_address,phone_number,tech_name,tech_slug,downloaded_date,tech_type,tech_type_value,reff_url)values('".addslashes($this->request->getPost('FirstName'))."',
'".addslashes($this->request->getPost('LastName'))."',
'".addslashes($this->request->getPost('companyname'))."',
'".addslashes($this->request->getPost('emailaddress'))."',
'".addslashes($this->request->getPost('phonenumber'))."',
'".addslashes($this->request->getPost('tech_name'))."',
'".addslashes($this->request->getPost('tech_slug'))."',
now(),
'".addslashes($this->request->getPost('payment_tech_type'))."',
'".addslashes($this->request->getPost('payment_tech_name'))."',
'".addslashes($this->request->getPost('pagefrom'))."')";
$success = $this->modelsManager->executeQuery($phql);


19.6k

Errr maybe if you put a space here:

..., reff_url) values(...



84.5k

You probably want to check if validation messages were produced:

$result = $manager->executeQuery($phql);
if ($result->success() == false)
{
    foreach ($result->getMessages() as $message)
    {
        echo $message->getMessage();
    }
}