| Index
» Projects
» phpMyEdit
» Forum
» Pass Current Key Value to PHP |
 |
brianwgr
Joined: 02 Jun 2010
Posts: 1
Posted: 2010-06-02 03:03
Back to top
Reply with quote
|
I am trying to create a checkbox in a virtual column with a unique value for each record. Here is my code:
| Code: |
$opts['fdd']['Export'] = array(
'name' => 'Export',
'select' => 'V',
'maxlen' => 1,
'nowrap' => true,
'sort' => false,
'sql' => "",
'php' => 'include/export.php',
'display' => 'V'
); |
My export.php looks like this:
| Code: |
$html = "<input type=\"checkbox\" name=\"exportList[]\" value=\"$key\" />";
return $html; |
I can't seem to get the value of my checkbox to be a unique identifier, hopefully, this value would be the value of my defined table key.
Any ideas how I can get the key value into the value field in my php file?
|
msavi
Joined: 26 Jan 2010
Posts: 10
Posted: 2010-07-08 12:42
Back to top
Reply with quote
|
did you find a solution to this problem - passing $key value to php.
thanks
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-07-10 14:53
Back to top
Reply with quote
|
| brianwgr wrote: |
| I can't seem to get the value of my checkbox to be a unique identifier, hopefully, this value would be the value of my defined table key. |
Untested, perhaps the following sql examples will help.
If a numeric identifier:
| Code: |
$opts['fdd']['dummy'] = array(
'name' => 'Dummy',
'options' => 'L',
'select' => 'T',
'sql' => 'your_key_column * 1',
'sort' => true
); |
If an alphanumeric identifier:
| Code: |
$opts['fdd']['dummy'] = array(
'name' => 'Dummy',
'options' => 'L',
'select' => 'T',
'sql' => 'your_key_column',
'sort' => true
); |
Did you try it with sql set as follows:
| Code: |
$opts['fdd']['Export'] = array(
'name' => 'Export',
'select' => 'V',
'maxlen' => 1,
'nowrap' => true,
'sort' => false,
'sql' => 'your_key_column',
'php' => 'include/export.php',
'display' => 'V'
); |
|
|
Post new topic
Reply to topic
|
|
|
|