Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Need some help defaulting a field on insert

phpMyEdit General     Need some help defaulting a field on insert
Post new topic   Reply to topic    
 
wwday3     Joined: 11 Apr 2011   Posts: 2  
Post Posted: 2011-04-11 06:07
Back to top  Reply with quote     

Runner ID is the field.

Originally, I thought making the field hidden and just defaulting the value would work. It did not.

Code:

$opts['fdd']['RunnerID'] = array(
  'options'  => 'H',
  'default'  => $user,
);


I noted that in the generated form RunnerID was not found, even as a hidden input field. I figured that was the issue. So, I then tried

Code:

$opts['cgi']['persist'] = array('RunnerID' => $user);


Which added RunnerID to the form as a hidden field. However, when Add was clicked, the value was not populated in the table. So, I added

Code:

$opts['cgi']['overwrite']['RunnerID'] = $user;


Same result. The hidden form field RunnerID is populated, but for whatever reason it is not added to the SQL insert operation (I haven't even messed with change/update yet).

After reading similar posts on the forum I also tried

Code:

$opts['fdd']['RunnerID'] = array(
  'options'  => 'R',
  'default'  => $user,
);


still with no positive results.

I really don't think it should be necessary to use an include file, especially for each separate operation for each database file.

Is there a way to do this that works? Do I have some sort of CGI restrictions I should look at?

 
wwday3     Joined: 11 Apr 2011   Posts: 2  
Post Posted: 2011-04-11 07:29
Back to top  Reply with quote     

Ha! I finally got it to work. I used the following:

Code:

$opts['fdd']['RunnerID'] = array(
  'options'  => 'HAP',
  'default'  => $user
);


It was the HAP that made it work (without sqlw - which didn't work on its own, or the cgi-overwrite, which also didn't work on its own)

So, now I'm HAPpy :)

 
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