This topic is locked
[SOLVED]

 Join Table - Edit Issue on Upgrade to 6.1

8/31/2012 12:06:11 PM
PHPRunner General questions
D
DAndras author

Hello everyone,
We are in the process of upgrading all of our sites from version 5.3 to version 6.1; however, we have encountered a pretty serious issue.
All of our sites worked just fine in terms of inline edit/edit options while using our joins in our SQL query in version 5.3. In version 6.1, however, it seems as if our joins are simply not working.
I presume that they did not get rid of the functionality of MySQL join in PHPRunner6.1.
Every time we attempt to edit a field that is being added to the web page through the use of join functionality, we encounter an error that states:
"Record was NOT edited. Unknown column 'x' in 'field_list'"
Would I have to create a View, perhaps, in the new version of PHPRunner in order to maintain my old functionality that was simply created through MySQL queries?
I appreciate all of your help. Keep in mind, I am not a php/mysql guru. I consider myself an apprentice.

Admin 8/31/2012

Check this article that explains how to update joined tables:

http://xlinesoft.com/phprunner/docs/update_multiple_tables.htm
The key is to remove fields that do not belong to the main table before updating the record.

D
DAndras author 8/31/2012

I believe I understand that for the most part; however, I am a little confused as to what I am supposed to be replacing the "..." with exactly.
Thank you very much for your prompt response and I'm sorry I need further clarification.
Edit:
I am following
$sql = "update table2 set field3=".$values["field3"]." where id2=".$values["id1"];

db_exec($sql,$conn);

unset($vales["field3"]);
and now I am getting an error that states my MySQL query is incorrect and causing a 256 error.
Unfortunately, I can not get to the "more info" button, since the pop-up box disappears every time I try to get near "more info" with my mouse.

Admin 8/31/2012

Print your query on the web page and run it manually against your database. Besides that $vales is incorrect, should be $values.
As a first step simply unset the field from joined table. This will allow your record to be saved. If you need to update a field in second table you can always add that part later.