Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, April 19, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Forcing a value in a column

phpMyEdit General     Forcing a value in a column
Post new topic   Reply to topic    
 
reinel.arias     Joined: 06 Sep 2005   Posts: 1  
Post 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  
Post 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    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy