This topic is locked
[SOLVED]

 Unknown column 'fieldname' in 'field list

7/22/2011 2:51:26 PM
PHPRunner General questions
D
dylan666 author

This is the query for my "Custom view":



SELECT

main.R,

main.`Name`,

main.`Address`,

main.`Age`,

main.`City`,

table2.updated,

table2.id

FROM main

, table2

WHERE (table2.updated<>0) AND (table2.id =R)

ORDER BY main.R DESC


Now I need to edit only the "table2.updated" value.

So in "Fields" section only "updated" is checked in "Edit" column.

But when I change the value and press "Save" I get this message:
Unknown column 'table2.updated' in 'field list'
Instead if in "Fields" section I check only for example "main.City" it works.

It doesn't work if I check one or more fiels from table2.

Why?
Thanks in advance

C
cgphp 7/23/2011

Hi dylan666,
a custom view creates an additional view of the same table. This feature is useful when you like to present several views of the same data.

Your Custom view was created for the table main so when you try to save the form, updated is a foreign field for the view.

D
dylan666 author 7/23/2011

Creating a Custom View from table2 with the same query will solve the problem?

C
cgphp 7/23/2011

No it will not solve the problem. It will work only for table2.

D
dylan666 author 7/24/2011

But I have to edit only one value and it is from table2.

There are not other values to edit from main as foreign fields

C
cgphp 7/25/2011



Creating a Custom View from table2 with the same query will solve the problem?


Yes, if you have to edit only the updated field in table2, then creating a Custom View from table2 with the same query will solve the problem !!

D
dylan666 author 7/25/2011