| Index
» Projekty
» phpMyEdit
» Fórum
» Forcing a value in a column |
 |
reinel.arias
Založený: 06.09.2005
Príspevky: 1
Zaslal: 2005-09-07 20:04
Návrat hore
Odpovedať s citátom
|
I have a table named "categories" with a special field named "instance"
This field is readonly and hidden, and all I want to do is to force it to contain certain value avoiding the user to type anything in this field.
I specified a trigger Before Insert where I hardcoded the value needed.
categories.php:
$opts['triggers']['insert']['before']='categories.TIB.inc';
categories.TIB.inc:
$newvals{'instance'}='forced value';
I just modified the $newvals array hoping phpMyEdit uses it in the corresponding sql INSERT sentence.
It didnt work.
Any ideas to accomplish this would be really appreciated,
Reinel
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2005-09-07 22:43
Návrat hore
Odpovedať s citátom
|
Why not just create a hidden field in PME and set the default to your forced value.
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.basic-options.html
Look for ['display'] = "H"
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|