You never set $del in your view() method. What do you expect to get deleted?
Ralf
stefbort schrieb:
Hi.
I am writing a new application, but I am newbie and I haven’t experience.
Well, my application likes addressbook. When I open a news screen to view a
record and click over delete botton I can see this error messages:
Database error: Invalid SQL: DELETE FROM egw_anagrafica WHERE
mysql Error: 1064 (You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near ‘’ at line 1)
File: /data_oratorio/egwana/etemplate/inc/class.so_sql.inc.php
Line: 521
Function: egw_db::delete / so_sql::delete / uianagrafica::view /
ExecMethod(anagrafica.uianagrafica.view) / etemplate::process_exec /
ExecMethod(etemplate.etemplate.process_exec)
Session halted.
If I click over edit button my application opens a empty page. Can anybody
help me?
I report more informations below.
I debug $contenet and I think the problem is the buttons don’t pass ID
record. Template of view page has all fields sets as “readonly”. Setting of
edit button is:
Type: submitbutton
Label: Edit
Name: edit[$anagrafica_id]
The application shows an index page in the first time. After I click over
"view" icon to open view page (this page shows record correctly). But if I
click over “Delete” or “Edit” button doesn’t work.
The code of view page is:
function view($content=null)
{
if ($content[‘nm’][‘rows’][‘view’])
{
list($id)=each($content[‘nm’][‘rows’][‘view’]);
if ($this->read($id))
{
foreach($this->data as $db_col => $col)
{
$content[$db_col]=$col;
}
}
}
if ($content[‘delete’])
{
$this->delete(array(‘anagrafica_id’=>$del));
}
if ($content[‘edit’])
{
$this->edit($content);
break;
}
if ($content[‘cancel’])
{
$this->index();
break;
}
$this->tmpl->read(‘anagrafica.view’);
$this->tmpl->exec(‘anagrafica.uianagrafica.view’,$content,$sel_options,$readonlys);
}
“anagrafica_id” is key field in application table. The debug of $content
when I click over delete button is:
debug… CONTENT
Array
(
[ana|bat|com|cre|mat|ord|fun] => anagrafica.view.ana
[delete] => Array
(
[0] => Delete
)
)
–
Ralf Becker
Director Software Development
Stylite GmbH
[open style of IT]
Morschheimer Strasse 15
67292 Kirchheimbolanden
fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
cell +49 (0) 170 7815917
mailto: rb@stylite.de
www.stylite.de
www.egroupware.org
Geschäftsführer Andre Keller, Nigel John Vickers,
Gudrun K. Müller und Ralf Becker
Registergericht Kaiserslautern HRB 12087
This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers