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  »  Change View does not show data from database

phpMyEdit General     Change View does not show data from database
Odoslať novú tému   Odpovedať na tému    
 
m123ooo     Založený: 29.09.2011   Príspevky: 4  
Príspevok Zaslal: 2011-09-29 11:16
Návrat hore  Odpovedať s citátom     

When I change view mode from Filter to Change text boxs are empty. Example is shown on the two images below.

Does anyone know why are text boxs empty and how to fix this?


Filter View:
Image
Change View:
Image

My code:
Kód:

$opts['fdd']['subjectID'] = array(
  'name'     => 'SubjectID',
  'select'   => 'T',
  'options'  => 'AVCPDR', // auto increment
  'maxlen'   => 11,
  'default'  => '0',
  'sort'     => true
);
$opts['fdd']['personID'] = array(
  'name'     => 'Person',
  'select'   => 'T',
  'maxlen'   => 11,
  'sort'     => true,
  'help|ACP' => '<a href="persons_edit.php" target="_blank">
               <!--[if !IE]> -->
                  <input type="button" value="Add person">
               <!-- <![endif]-->
               <!--[if IE]>
                  Add person
               <![endif]-->
            <a/>'
);


$opts['fdd']['personID']['values']['table'] = 'persons';
$opts['fdd']['personID']['values']['column'] = 'personID';
$opts['fdd']['personID']['values']['description']['columns'][0] = 'firstname';
$opts['fdd']['personID']['values']['description']['divs'][0] = ' ';
$opts['fdd']['personID']['values']['description']['columns'][1] = 'lastname';
$opts['fdd']['personID']['values']['filters'] = 'groupID <> 4';

$opts['fdd']['studyProgrammeID'] = array(
  'name'     => 'Study Programme',
  'select'   => 'T',
  'maxlen'   => 11,
  'sort'     => true
);

$opts['fdd']['studyProgrammeID']['values']['table'] = 'study_programmes';
$opts['fdd']['studyProgrammeID']['values']['column'] = 'studyProgrammeID';
$opts['fdd']['studyProgrammeID']['values']['description']['columns'][0] = 'title';

$opts['fdd']['title'] = array(
  'name'     => 'Title',
  'select'   => 'T',
  'maxlen'   => 200,
  'sort'     => true
);
$opts['fdd']['year'] = array(
  'name'     => 'Number of years',
  'select'   => 'N',
  'maxlen'   => 1,
  'sort'     => true
);
$opts['fdd']['hours'] = array(
  'name'     => 'Number of hours',
  'select'   => 'N',
  'maxlen'   => 3,
  'sort'     => true
);
$opts['fdd']['lectures'] = array(
  'name'     => 'Number of lectures',
  'select'   => 'N',
  'maxlen'   => 3,
  'sort'     => true
);
$opts['fdd']['exercises'] = array(
  'name'     => 'Number of exercises',
  'select'   => 'N',
  'maxlen'   => 3,
  'sort'     => true
);


 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-09-29 17:45
Návrat hore  Odpovedať s citátom     

Those images are awfully small. Try replacing ['values'] with ['values2']

 
m123ooo     Založený: 29.09.2011   Príspevky: 4  
Príspevok Zaslal: 2011-09-29 18:04
Návrat hore  Odpovedať s citátom     

Click images and in new window scroll down. Then you will see full size.

The problem isn't just with those that have ['values'].
Text boxes are also empty at

Kód:

$opts['fdd']['title']
$opts['fdd']['year']
$opts['fdd']['hours']


etc..

Did you had similar problem?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-09-29 18:09
Návrat hore  Odpovedať s citátom     

Lacking the time to fully study the code, I suggest re-creating the form from scratch, then making small modifications and testing after each modification.

 
m123ooo     Založený: 29.09.2011   Príspevky: 4  
Príspevok Zaslal: 2011-09-29 18:20
Návrat hore  Odpovedať s citátom     

The problem is, that if a form from scratch has this problem.

I thought maybe I wrote something wrong, then test fresh form and had same problem.

And not only that.. Some forms when I add new record, they don't store it in database. For instance.. 'title' column in database stays empty or if I write 'number of years' has 0 in database column.

...

I have found the problem.. I was tweaking phpMyEdit.class.php and now, everything is working properly.

I was searching the problem in my edit.php, but you helped me notice that it might not be the problem here.

Thank you for your help!

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-09-29 18:28
Návrat hore  Odpovedať s citátom     

You might want to make sure the names of your columns, tables, and databases are NOT reserved words.
http://www.hockinson.com/programmer-web-designer-denver-co-usa.php?s=43

 
m123ooo     Založený: 29.09.2011   Príspevky: 4  
Príspevok Zaslal: 2011-09-29 18:37
Návrat hore  Odpovedať s citátom     

Thanks! I will check those tables that have this problem.

Do you perhaps know how to create dummy/virtual column (without MySQL error 1054) and show values from another table and store them in 'another' table in Add view?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2011-09-29 19:11
Návrat hore  Odpovedať s citátom     

Not really, though I do have this example where the 'user' column already exists before the dummy field is added.

Kód:
$opts['fdd']['user'] = array(
  'default'    => '',
  'input'      => '',
  'maxlen'     => 20,
  'name'       => 'User Name',
  'options'    => 'ACPVDFL',
  'required'   => true,
  'select'     => 'D',
  'size|ACP'   => 20,
  'sqlw'       => 'TRIM("$val_as")',
  'sort'       => true,
  'values'     => array(
    'table'       => 'vs_users',
    'column'      => 'user_name',
    'description' => array(
       'columns'  => array('0' => 'last_name', '1' => 'first_name'),
       'divs'     => array('0' => ', '),
     ),
    'filters'     => 'hidden = "0" AND deleted = "0"',
    'orderby'     => 'last_name')
);

// Dummy/Virtual field looks up user level, displaying it in lighter color
// PMEjoin1 was created above when looking up last_name and first_name

$opts['fdd']['virtual_1'] = array(
   'colattrs' => 'style="color:#999999;background-color:transparent"',
   'input'    => 'VR',
   'name'     => 'UL',
   'options'  => 'LFV',
   'sql'      => 'PMEjoin1.user_level'
);


 
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