couldnt-execute-query-unknown-column-cat_nm-in-field-list

Questionscouldnt-execute-query-unknown-column-cat_nm-in-field-list
Mustafa Khalil asked 1 year ago

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\”;

3 Answers
Abu Ghufran Staff answered 1 year ago

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”

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Mustafa answered 1 year ago

I\’ve tried using real field name but it still appear same error

Abu Ghufran Staff answered 12 months ago

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.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

19 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?