Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Forcing a value in a column

phpMyEdit General     Forcing a value in a column
Odoslať novú tému   Odpovedať na tému    
 
reinel.arias     Založený: 06.09.2005   Príspevky: 1  
Príspevok 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  
Príspevok 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    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov