afridy
January 7, 2015, 9:13am
1
Hi folks,
$query = $db->prepare("INSERT INTO companies('',name,address,city,phone,email,fax,web,type,employees,group_hrm_name,contact_name,contact_mobile)
VALUES('',:name,:address,:city,:phone,:email,:fax,:web,:type,:employees,:group_hrm_name,:contact_name,:contact_mobile)");
$query->execute(array(':name' => $name,
':address' => $address,
':city' => $city,
':phone' => $phone,
':email' => $email,
':fax' => $fax,
':web' => $web,
':type' => $type,
':employees' => $employees,
':group_hrm_name' => $group_hrm_name,
':contact_name' => $contact_name,
':contact_mobile' => $contact_mobile));
Note: in above error , add_ajax.js (line 67) is
xmlhttp.send(null);
rpkamp
January 7, 2015, 9:41am
2
Itβs probably the ββ there. You need to supply column names there, not sure what your intententions were with ββ, but itβs not valid at that point.
afridy
January 7, 2015, 9:42am
3
That empty two single quotes are for the record id which is an auto increment column
rpkamp
January 7, 2015, 9:43am
4
Then you need to put the id column name there (probably id
or similar), and not ββ.
The value can indeed be empty for auto increment, but the column name can not.
1 Like
afridy
January 7, 2015, 9:46am
5
oooch!! yes, there is a mistake. now i have corrected it . But still i am getting the same error.
$query = $db->prepare("INSERT INTO companies(company_id,name,address,city,phone,email,fax,web,type,employees,group_hrm_name,contact_name,contact_mobile)
VALUES('',:name,:address,:city,:phone,:email,:fax,:web,:type,:employees,:group_hrm_name,:contact_name,:contact_mobile)");
afridy
January 7, 2015, 10:31am
8
Thanks ScallioXTX,
you spotted the problem. now problem solved. yes, column name not specifying is the problem.
Thank you.
system
Closed
April 8, 2015, 5:43pm
9
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.