| Index
» Projects
» phpMyEdit
» Forum
» update trigger with filter |
 |
depika
Joined: 22 May 2006
Posts: 5
Posted: 2008-01-07 14:36
Back to top
Reply with quote
|
I am trying to create an update trigger but it doesn't seem to work
Here is part of my file.
| Code: |
$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
| Code: |
<?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
Joined: 20 Sep 2007
Posts: 6
Posted: 2008-02-14 13:37
Back to top
Reply with quote
|
you need to manually SELECT the field from table 'odoi' inside the trigger
| Code: |
$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'];
|
|
|
Post new topic
Reply to topic
|
|
|
|