override auto rdcaccount_id clause in a manually extended SQL [message #1990] |
Sun, 19 April 2009 11:07 |
gpatti
Messages: 283 Registered: August 2008
|
Senior Member |
|
|
Tony,
In a _cm_getInitialDataMultiplefunction within a table class I have manually extended $this->sql_from and $this->sql_where to include data from a second table to achieve some desired functionality. Both the tables include the rdcaccount_id column.
I'm using getData_raw to retrieve the data.
Unfortunately this is now generating an ambiguous reference to rdcaccount_id (the table name is not explicitly stated in the generated SQL).
Can you give me a pointer to resolve this please?
Thanks,
Graham
[Updated on: Sun, 19 April 2009 11:15] Report message to a moderator
|
|
|
|
|
|
|
Re: override auto rdcaccount_id clause in a manually extended SQL [message #1995 is a reply to message #1994] |
Mon, 20 April 2009 11:03 |
AJM
Messages: 2367 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
You need to modify the contents of the getData() and getData_raw() methods in your version of 'std.table.class.inc' so that the lines containing
$account_id_string = "rdcaccount_id='1'";
- and -
$account_id_string = "rdcaccount_id IN ('1', '$account_id')";
are changed to include the table name, as in:
$account_id_string = "$this->tablename.rdcaccount_id='1'";
- and -
$account_id_string = "$this->tablename.rdcaccount_id IN ('1', '$account_id')";
Let me know if this solves your problem.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|
|
|
|
|
|
|