| Index
» Projekty
» phpMyEdit
» Fórum
» update trigger with filter |
 |
depika
Založený: 22.05.2006
Príspevky: 5
Zaslal: 2008-01-07 14:36
Návrat hore
Odpovedať s citátom
|
I am trying to create an update trigger but it doesn't seem to work
Here is part of my file.
| Kód: |
$opts['filters'] = "STREET_UPPERCASE = 'Ω - ΛΑΘΗ / ΑΛΛΟΠΡΟΣΑΛΑ' ";
$opts['triggers']['update']['after'] = 'update.php';
$opts['fdd']['ID'] = array(
'name' => 'ID',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 11,
'default' => '0',
'sort' => true
);
$opts['fdd']['STREET'] = array(
'name' => 'STREET',
'select' => 'T',
'maxlen' => 200,
'sort' => true
);
$opts['fdd']['CODE_STREET'] = array(
'name' => 'STREET_UPPERCASE',
'select' => 'D',
'maxlen' => 50,
'required' => true,
'sort' => false
);
$opts['fdd']['CODE_STREET']['values']['table'] = 'odoi';
$opts['fdd']['CODE_STREET']['values']['column'] = 'CODE_STREET';
$opts['fdd']['CODE_STREET']['values']['description'] = 'STREET_UPPERCASE'; // optional |
Here is my update.php
| Kód: |
<?php
$newvals['STREET'] = $newvals['STREET_UPPERCASE'];
?> |
What I need is upon update to copy the description STEET_UPPERCASE that is being displayed in the field CODE_STREET to field STREET.
I would appreciate your help
Depika
Athens Greece
|
exio82
Založený: 20.09.2007
Príspevky: 6
Zaslal: 2008-02-14 13:37
Návrat hore
Odpovedať s citátom
|
you need to manually SELECT the field from table 'odoi' inside the trigger
| Kód: |
$sql = 'SELECT STREET_UPPERCASE FROM odoi WHERE CODE_STREET=\''.$newvals['CODE_STREET'].'\'';
$result=$this->myQuery($sql);
$row=mysql_fetch_assoc($result);
$newvals['STREET'] = $row['STREET_UPPERCASE'];
|
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|