hello im trying to join two table in select query and im using two dropdown select and each one is for similar table but when trying to add new record this message is appear : Couldn\’t execute query. Unknown column \’Cat_Nm\’ in \’field list\’ – INSERT INTO details (`Cat_Nm`,`ModelNo`,`TempNo`,`Cat_Type`,`price`,`photo`) VALUES (\’\’,\’345\’,\’543\’,\’543\’,\’45\’,\’photos/IMG-20170815-WA0048_2.jpg\’) and this this my select query : $g->select_command = \”Select d.id , d.price , d.TempNo , d.ModelNo , d.cat , d.Notes , d.Cat_Type , photo , c.Client_nm , t.Name as Cat_Nm from details d inner join clients c on d.ClientName = c.Client_nm inner join category t on d.cat = t.Name\”;
Hi,
Cat_Nm field is field alias and does not exist in table. So for insert you need to use real field name in ‘name’ property. e.g.
$col[“name”] = “cat”
Your ticket somehow get delayed. If your issue still exist, please send complete code and database dump to regenerate issue here.
Good practice in debugging would be to run this query on sql ide (e.g. phpmyadmin) and correct what is missing then paste expected query here.