This topic is locked

Editing a Single Record

10/17/2007 4:15:53 AM
PHPRunner General questions
J
jje author

I receive the following error: "ORA 00937 - not a single group function" when a try to setup only a single record edit page without the requiring of a list page.
Typical my query would be like be: select max(field1), field2, field3 from table1;
Is there any workaround for this problem?

Alexey admin 10/17/2007

Hi,
this type of queries don't work with Oracle.
Describe what are you trying to select and edit and I'll try to help you.

J
jje author 10/18/2007

Hi,
Sorry my fault - the query now looks like this and it works as I get only a single record:
select field1, field2, id from table1 where id=(select max(id) from table1)
My question now is how can I bypass the List page and go direct to the edit page automatically?
Also how can I prevent that a user cannot type in any ID number in the url and edit another page?

Alexey admin 10/18/2007

Hi,
use this code in Edit page: Before process event.

$sql = "select max(id) from table1";

$rs = db_query($sql,$conn);

$data = db_fetch_numarray($rs);
$_POST["editid1"]=$data[0];

$_GET["editid1"]=$data[0];

J
jje author 10/25/2007

Hi,

use this code in Edit page: Before process event.


Hi,
Thanks for that commands. Can you perhaps help me with the following:
The value of the variable ($data[0]) that I use in the event function 'Edit Before Process' , how can I recall the same value in another event function 'After Record Update'

Alexey admin 10/25/2007

use $_POST["editid1"] to get that value.