Index
» Projects
» phpMyEdit
» Forum
» Forcing a value in a column |
|
reinel.arias
Joined: 06 Sep 2005
Posts: 1
Posted: 2005-09-07 20:04
Back to top
Reply with quote
|
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
Joined: 17 Dec 2003
Posts: 236
Posted: 2005-09-07 22:43
Back to top
Reply with quote
|
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"
|
Post new topic
Reply to topic
|
|
|
|