daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-16 09:52
Back to top
Reply with quote
|
I must have defined a field incorrectly in PME.
I have records (photograph info) organized by a unique ID. Some records have the same Title, even though they are different entities (with unique IDs).
When a change a field (for example, "Date Printed"), in record A, all elements of record B are changed to be the same as record A.
Any ideas where to look?
Many thanks.
David
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-16 15:52
Back to top
Reply with quote
|
Consider posting the schema from the table, as exported using phpMyAdmin, along with the code from your script.
|
daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-16 21:22
Back to top
Reply with quote
|
Hi Doug, thanks a ton for answering. UPDATED. I POSTED CODE FROM THE WRONG FILE... Sorry. It's the correct file now.
Here is the code:
Code: |
<?php
header('Content-Type: text/html; charset=iso-8859-2');
?>
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; }
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0,
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1,
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; }
td.pme-buttons { text-align: left; }
td.pme-message { text-align: center; }
td.pme-stats { text-align: right; }
</style><?php
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, check official documentation. It is available
* online and also for download on phpMyEdit project management page:
*
* http://platon.sk/projects/main_page.php?project_id=5
*
* This file was generated by:
*
* phpMyEdit version: 5.7.1
* phpMyEdit.class.php core class: 1.204
* phpMyEditSetup.php script: 1.50
* generating setup script: 1.50
*/
// MySQL host name, user name, password, database, and table
$opts['hn'] = 'localhost';
$opts['un'] = '';
$opts['pw'] = '';
$opts['db'] = 'beatric2_photoBase';
$opts['tb'] = 'prints';
// Name of field which is the unique key
$opts['key'] = 'print_id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'real';
// Sorting field(s)
$opts['sort_field'] = array('print_id');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = 15;
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'CPVDF';
// Number of lines to display on multiple selection filters
$opts['multiple'] = '4';
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'DB';
// Display special page elements
$opts['display'] = array(
'form' => true,
'query' => true,
'sort' => true,
'time' => true,
'tabs' => true
);
// Set default prefixes for variables
$opts['js']['prefix'] = 'PME_js_';
$opts['dhtml']['prefix'] = 'PME_dhtml_';
$opts['cgi']['prefix']['operation'] = 'PME_op_';
$opts['cgi']['prefix']['sys'] = 'PME_sys_';
$opts['cgi']['prefix']['data'] = 'PME_data_';
/* Get the user's default language and use it if possible or you can
specify particular one you want to use. Refer to official documentation
for list of available languages. */
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';
/* Table-level filter capability. If set, it is included in the WHERE clause
of any generated SELECT statement in SQL query. This gives you ability to
work only with subset of data from table.
$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
*/
/* Field definitions
Fields will be displayed left to right on the screen in the order in which they
appear in generated list. Here are some most used field options documented.
['name'] is the title used for column headings, etc.;
['maxlen'] maximum length to display add/edit/search input boxes
['trimlen'] maximum length of string content to display in row listing
['width'] is an optional display width specification for the column
e.g. ['width'] = '100px';
['mask'] a string that is used by sprintf() to format field output
['sort'] true or false; means the users may sort the display on this column
['strip_tags'] true or false; whether to strip tags from content
['nowrap'] true or false; whether this field should get a NOWRAP
['select'] T - text, N - numeric, D - drop-down, M - multiple selection
['options'] optional parameter to control whether a field is displayed
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view
Another flags are:
R - indicates that a field is read only
W - indicates that a field is a password field
H - indicates that a field is to be hidden and marked as hidden
['URL'] is used to make a field 'clickable' in the display
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff';
['URLtarget'] HTML target link specification (for example: _blank)
['textarea']['rows'] and/or ['textarea']['cols']
specifies a textarea is to be used to give multi-line input
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10
['values'] restricts user input to the specified constants,
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99)
['values']['table'] and ['values']['column'] restricts user input
to the values found in the specified column of another table
['values']['description'] = 'desc_column'
The optional ['values']['description'] field allows the value(s) displayed
to the user to be different to those in the ['values']['column'] field.
This is useful for giving more meaning to column values. Multiple
descriptions fields are also possible. Check documentation for this.
*/
$opts['fdd']['recordid'] ['options'] = 'H';
/*
$opts['fdd']['recordid'] = array(
'name' => 'Recordid',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
*/
$opts['fdd']['photo_title'] = array(
'name' => 'Photo Title',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['image_size'] = array(
'name' => 'Image size',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['print_serial_number'] = array(
'name' => 'Print Number',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['date_printed'] = array(
'name' => 'Date printed',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['disposition'] = array(
'name' => 'Status',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['date_of_disposition'] = array(
'name' => 'Date of disposition',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['frame_type'] = array(
'name' => 'Frame type',
'select' => 'T',
'maxlen' => 15,
'sort' => true
);
$opts['fdd']['studio_location_id'] = array(
'name' => 'Studio location ID',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['customer_id'] ['options'] = 'H';
/*
$opts['fdd']['customer_id'] = array(
'name' => 'Customer ID',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
*/
$opts['fdd']['customer_serial_no'] = array(
'name' => 'Customer serial no',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['sold_price_actual'] = array(
'name' => 'Sold price actual',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['edition_serial_no'] ['options'] = 'H';
$opts['fdd']['print_id'] ['options'] = 'H';
/*
$opts['fdd']['edition_serial_no'] = array(
'name' => 'Edition serial no',
'options' => 'H', // hidden
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['print_id'] = array(
'name' => 'Print ID',
'options' => 'H', // hidden
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
*/
// Now important call to phpMyEdit
require_once 'phpMyEdit.class.php';
new phpMyEdit($opts);
?>
|
I'm not sure how to add the schema to this message, but you may be able to get it here: http://bohtech.com/files/prints.sql.zip
Warm regards
David
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-16 22:07
Back to top
Reply with quote
|
ENGINE=InnoDB
phpMyEdit only works with MyISAM tables.
|
daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-16 22:16
Back to top
Reply with quote
|
ah ok. If I convert the table to myIsam, should that be ok?
If so, a follow-on question.
Some people's names are in Greek. Is there a way to show greek as well as english letters?
Many thanks
David
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-16 23:14
Back to top
Reply with quote
|
I would expect your script to work after converting from innodb to myisam.
I saw UTF8 in your schema, thus any accented characters should work if you also set the appropriate meta tags, and if your db connection applies the UTF8. A combination of the meta tags and db connection calls are required to produce the desired results. I always use UTF8_GENERAL_CI.
Rough examples are:
Code: |
<meta http-equiv="charset" content="UTF-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
Code: |
if(!@mysql_query('SET NAMES UTF8', $opts['dbh'])){
echo mysql_error();
}
if(!@mysql_query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI', $opts['dbh'])){
echo mysql_error();
} |
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-16 23:19
Back to top
Reply with quote
|
If necessary, in the class file, you might need to amend function execute() by adding the following.
Code: |
if(!@mysql_query('SET NAMES UTF8')){ error(mysql_error()); }
if(!@mysql_query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI')){ error(mysql_error()); }
|
|
daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-17 01:42
Back to top
Reply with quote
|
Doug, it's 3:30 or so am, here in Greece. So far, I have not been able to solve either problem.
I changed the tables to MYISAM and added the UTF-8 code as you suggested.
I will look anew in the morning, but if you want to see code/files again, please let me know, and I very much appreciate the help.
David
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-17 03:12
Back to top
Reply with quote
|
The forum has a Search feature. Conduct a search for COLLATION_CONNECTION or UTF8 or SET NAMES UTF8
Clear your browser cache as well, as it may interfere with new results. It should be as simple as setting the 2 extra queries after the db connection and applying the above META tags.
|
daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-17 04:11
Back to top
Reply with quote
|
Hi again. I first need to solve the problem of why - when I try to update a record, PME updates all records with the same Title. The unique identifier is a "Print-Id".
If you would be so kind as to look at the code again, and the sql file, I would be most grateful..
Code: |
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, td.pme-navigation-1 { white-space: nowrap; }
th.pme-header { border: #004d9c 1px solid; padding: 4px; background: #add8e6; }
td.pme-key-0, td.pme-value-0, td.pme-help-0, td.pme-navigation-0, td.pme-cell-0,
td.pme-key-1, td.pme-value-1, td.pme-help-0, td.pme-navigation-1, td.pme-cell-1,
td.pme-sortinfo, td.pme-filter { border: #004d9c 1px solid; padding: 3px; }
td.pme-buttons { text-align: left; }
td.pme-message { text-align: center; }
td.pme-stats { text-align: right; }
</style>
<?php
/*
* IMPORTANT NOTE: This generated file contains only a subset of huge amount
* of options that can be used with phpMyEdit. To get information about all
* features offered by phpMyEdit, check official documentation. It is available
* online and also for download on phpMyEdit project management page:
*
* http://platon.sk/projects/main_page.php?project_id=5
*
* This file was generated by:
*
* phpMyEdit version: 5.7.1
* phpMyEdit.class.php core class: 1.204
* phpMyEditSetup.php script: 1.50
* generating setup script: 1.50
*/
// MySQL host name, user name, password, database, and table
$opts['hn'] = 'localhost';
$opts['un'] = '';
$opts['pw'] = '';
$opts['db'] = 'beatric2_photoBase';
$opts['tb'] = 'prints';
// Name of field which is the unique key
$opts['key'] = 'print_id';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'real';
// Sorting field(s)
$opts['sort_field'] = array('print_id');
// Number of records to display on the screen
// Value of -1 lists all records in a table
$opts['inc'] = 15;
// Options you wish to give the users
// A - add, C - change, P - copy, V - view, D - delete,
// F - filter, I - initial sort suppressed
$opts['options'] = 'CPVDF';
// Number of lines to display on multiple selection filters
$opts['multiple'] = '4';
// Navigation style: B - buttons (default), T - text links, G - graphic links
// Buttons position: U - up, D - down (default)
$opts['navigation'] = 'DB';
// Display special page elements
$opts['display'] = array(
'form' => true,
'query' => true,
'sort' => true,
'time' => true,
'tabs' => true
);
// Set default prefixes for variables
$opts['js']['prefix'] = 'PME_js_';
$opts['dhtml']['prefix'] = 'PME_dhtml_';
$opts['cgi']['prefix']['operation'] = 'PME_op_';
$opts['cgi']['prefix']['sys'] = 'PME_sys_';
$opts['cgi']['prefix']['data'] = 'PME_data_';
/* Get the user's default language and use it if possible or you can
specify particular one you want to use. Refer to official documentation
for list of available languages. */
$opts['language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '-UTF8';
/* Table-level filter capability. If set, it is included in the WHERE clause
of any generated SELECT statement in SQL query. This gives you ability to
work only with subset of data from table.
$opts['filters'] = "column1 like '%11%' AND column2<17";
$opts['filters'] = "section_id = 9";
$opts['filters'] = "PMEtable0.sessions_count > 200";
*/
/* Field definitions
Fields will be displayed left to right on the screen in the order in which they
appear in generated list. Here are some most used field options documented.
['name'] is the title used for column headings, etc.;
['maxlen'] maximum length to display add/edit/search input boxes
['trimlen'] maximum length of string content to display in row listing
['width'] is an optional display width specification for the column
e.g. ['width'] = '100px';
['mask'] a string that is used by sprintf() to format field output
['sort'] true or false; means the users may sort the display on this column
['strip_tags'] true or false; whether to strip tags from content
['nowrap'] true or false; whether this field should get a NOWRAP
['select'] T - text, N - numeric, D - drop-down, M - multiple selection
['options'] optional parameter to control whether a field is displayed
L - list, F - filter, A - add, C - change, P - copy, D - delete, V - view
Another flags are:
R - indicates that a field is read only
W - indicates that a field is a password field
H - indicates that a field is to be hidden and marked as hidden
['URL'] is used to make a field 'clickable' in the display
e.g.: 'mailto:$value', 'http://$value' or '$page?stuff';
['URLtarget'] HTML target link specification (for example: _blank)
['textarea']['rows'] and/or ['textarea']['cols']
specifies a textarea is to be used to give multi-line input
e.g. ['textarea']['rows'] = 5; ['textarea']['cols'] = 10
['values'] restricts user input to the specified constants,
e.g. ['values'] = array('A','B','C') or ['values'] = range(1,99)
['values']['table'] and ['values']['column'] restricts user input
to the values found in the specified column of another table
['values']['description'] = 'desc_column'
The optional ['values']['description'] field allows the value(s) displayed
to the user to be different to those in the ['values']['column'] field.
This is useful for giving more meaning to column values. Multiple
descriptions fields are also possible. Check documentation for this.
*/
$opts['fdd']['recordid'] ['options'] = 'H';
/*
$opts['fdd']['recordid'] = array(
'name' => 'Recordid',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 10,
'default' => '0',
'sort' => true
);
*/
$opts['fdd']['photo_title'] = array(
'name' => 'Photo Title',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['image_size'] = array(
'name' => 'Image size',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['print_serial_number'] = array(
'name' => 'Print Number',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['date_printed'] = array(
'name' => 'Date printed',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['disposition'] = array(
'name' => 'Status',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['date_of_disposition'] = array(
'name' => 'Date of disposition',
'select' => 'T',
'maxlen' => 10,
'sort' => true
);
$opts['fdd']['frame_type'] = array(
'name' => 'Frame type',
'select' => 'T',
'maxlen' => 15,
'sort' => true
);
$opts['fdd']['studio_location_id'] = array(
'name' => 'Studio location ID',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['customer_id'] ['options'] = 'H';
/*
$opts['fdd']['customer_id'] = array(
'name' => 'Customer ID',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
*/
$opts['fdd']['customer_serial_no'] = array(
'name' => 'Customer serial no',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['sold_price_actual'] = array(
'name' => 'Sold price actual',
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['edition_serial_no'] ['options'] = 'H';
$opts['fdd']['print_id'] ['options'] = 'H';
/*
$opts['fdd']['edition_serial_no'] = array(
'name' => 'Edition serial no',
'options' => 'H', // hidden
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
$opts['fdd']['print_id'] = array(
'name' => 'Print ID',
'options' => 'H', // hidden
'select' => 'T',
'maxlen' => 22,
'sort' => true
);
*/
// Now important call to phpMyEdit
require_once 'phpMyEdit.class.php';
new phpMyEdit($opts);
?>
and the sql file is here: http://bohtech.com/files/prints2.sql.zip
Many thanks
David
|
Last edited by daviddelmonte on 2010-05-17 05:08, edited 1 time in total
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-17 04:18
Back to top
Reply with quote
|
The schema referenced above indicates that `recordid` is the unique identifier. Did you change your database connection to work with a new db of the MyISAM type? If it remains as INNODB then there will be all sorts of erroneous results.
Code: |
CREATE TABLE IF NOT EXISTS `prints` (
`recordid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`photo_title` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`negative_id` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`edition_id` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`print_serial_number` double DEFAULT NULL,
`edition_serial_no` double DEFAULT NULL,
`print_id` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`date_printed` date DEFAULT NULL,
`paper_type` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`disposition` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`date_of_disposition` date DEFAULT NULL,
`image_size` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`image_width` varchar(10) COLLATE utf8_bin DEFAULT NULL,
`image_height` int(10) DEFAULT NULL,
`frame_type` varchar(15) CHARACTER SET utf8 DEFAULT NULL COMMENT 'Examples: Wood, Metal',
`frame_width` int(10) DEFAULT NULL,
`frame_height` int(10) DEFAULT NULL,
`frame_size_units` varchar(10) COLLATE utf8_bin DEFAULT '' COMMENT 'mm, cm, inches',
`studio_location_id` double DEFAULT NULL,
`customer_id` varchar(25) COLLATE utf8_bin DEFAULT NULL,
`customer_serial_no` double DEFAULT NULL,
`sold_price_actual` double DEFAULT NULL,
PRIMARY KEY (`recordid`),
KEY `Prints_edition_serial_no_idx` (`edition_serial_no`),
KEY `Prints_customer_serial_no_idx` (`customer_serial_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1850 ; |
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-17 04:20
Back to top
Reply with quote
|
try
Code: |
// Name of field which is the unique key
$opts['key'] = 'recordid';
// Type of key field (int/real/string/date etc.)
$opts['key_type'] = 'int'; |
|
daviddelmonte
Joined: 10 Apr 2010
Posts: 15
Posted: 2010-05-17 04:30
Back to top
Reply with quote
|
Doug, you're a genius. That solved the multiple update problem.. I was referencing the wrong key field..
it was a long day..
Many thanks!!!!
Now to try to fix the character set.
I'm not sure if the set should be UTF8 or iso-8859-7
I'll play some more and look for the forum notes you suggested.
Now - one last question... If I have more data elements than screen real estate, can you fold a record onto two lines?
If so, what's that technique called and could you point me in the right direction..
Again... MANY thanks!!!
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-17 04:32
Back to top
Reply with quote
|
well, after all, the page at
http://www.realmacsoftware.com/forums/index.php/forums/member/26820/
indicates "worked for the World Bank for 100 years" so many you're too old to mess with this stuff [grin, laugh]
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2010-05-17 04:34
Back to top
Reply with quote
|
Use UTF8 in your META tags. In View or List modes, the MySQL CONCAT function could be used to display two fields on one line (search the forum for CONCAT examples).
|
Post new topic
Reply to topic
Goto page 1, 2, 3 ... 29, 30, 31 Next
|
|