PMA_table_info
This commit is contained in:
@@ -596,7 +596,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
<li>
|
<li>
|
||||||
display in an optional tooltip the "display field"
|
display in an optional tooltip the "display field"
|
||||||
when browsing the master table, if you move the mouse to a column
|
when browsing the master table, if you move the mouse to a column
|
||||||
containing a foreign key;
|
containing a foreign key (use also the 'table_info' table);
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
display links on the table properties page, to check referential
|
display links on the table properties page, to check referential
|
||||||
@@ -626,7 +626,6 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
`master_field` varchar(64) NOT NULL default '',<br />
|
`master_field` varchar(64) NOT NULL default '',<br />
|
||||||
`foreign_table` varchar(64) NOT NULL default '',<br />
|
`foreign_table` varchar(64) NOT NULL default '',<br />
|
||||||
`foreign_field` varchar(64) NOT NULL default '',<br />
|
`foreign_field` varchar(64) NOT NULL default '',<br />
|
||||||
`foreign_display_field` varchar(64) NOT NULL default '',<br />
|
|
||||||
`pdf_page_number` int(11) NOT NULL default '0',<br />
|
`pdf_page_number` int(11) NOT NULL default '0',<br />
|
||||||
PRIMARY KEY (`master_table`,`master_field`),<br />
|
PRIMARY KEY (`master_table`,`master_field`),<br />
|
||||||
KEY pdf_page_number (`pdf_page_number`)<br />
|
KEY pdf_page_number (`pdf_page_number`)<br />
|
||||||
@@ -649,7 +648,6 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
ALTER TABLE `PMA_relation` CHANGE src_column master_field VARCHAR(64) NOT NULL<br />
|
ALTER TABLE `PMA_relation` CHANGE src_column master_field VARCHAR(64) NOT NULL<br />
|
||||||
ALTER TABLE `PMA_relation` CHANGE dest_table foreign_table VARCHAR(64) NOT NULL<br />
|
ALTER TABLE `PMA_relation` CHANGE dest_table foreign_table VARCHAR(64) NOT NULL<br />
|
||||||
ALTER TABLE `PMA_relation` CHANGE dest_column foreign_field VARCHAR(64) NOT NULL<br />
|
ALTER TABLE `PMA_relation` CHANGE dest_column foreign_field VARCHAR(64) NOT NULL<br />
|
||||||
ALTER TABLE `PMA_relation` ADD `foreign_display_field` VARCHAR(64) NOT NULL;<br />
|
|
||||||
ALTER TABLE `PMA_relation` ADD `pdf_page_number` int(11) NOT NULL;<br />
|
ALTER TABLE `PMA_relation` ADD `pdf_page_number` int(11) NOT NULL;<br />
|
||||||
ALTER TABLE `PMA_relation` ADD INDEX(`pdf_page_number`);<br />
|
ALTER TABLE `PMA_relation` ADD INDEX(`pdf_page_number`);<br />
|
||||||
</tt><br />
|
</tt><br />
|
||||||
@@ -660,11 +658,17 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
Since release 2.3.0 you can describe, in a special 'table_info'
|
Since release 2.3.0 you can describe, in a special 'table_info'
|
||||||
table, the coordinates where each table will be placed on a PDF schema
|
table
|
||||||
output. This configuration variable will hold the name of this special
|
<ul>
|
||||||
|
<li>the coordinates where each table will be placed on a PDF schema
|
||||||
|
output</li>
|
||||||
|
<li>which field is to be displayed as a tooltip when moving the
|
||||||
|
cursor over the corresponding key</li>
|
||||||
|
</ul>
|
||||||
|
This configuration variable will hold the name of this special
|
||||||
table.
|
table.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
This feature is supported under PHP4, and you must be using also the
|
PDF output is supported under PHP4, and you must be using also the
|
||||||
'relation' feature. Also, we used the fpdf library which currently
|
'relation' feature. Also, we used the fpdf library which currently
|
||||||
only supports iso-8859 (Latin1) character sets in PDF.
|
only supports iso-8859 (Latin1) character sets in PDF.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
@@ -678,6 +682,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
`table_name` varchar(64) NOT NULL default '',<br />
|
`table_name` varchar(64) NOT NULL default '',<br />
|
||||||
`x` float unsigned NOT NULL default '0',<br />
|
`x` float unsigned NOT NULL default '0',<br />
|
||||||
`y` float unsigned NOT NULL default '0',<br />
|
`y` float unsigned NOT NULL default '0',<br />
|
||||||
|
`display_field` varchar(64) NOT NULL default '',<br />
|
||||||
PRIMARY KEY (`table_name`)<br />
|
PRIMARY KEY (`table_name`)<br />
|
||||||
) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';<br />
|
) TYPE=MyISAM COMMENT='Table information for phpMyAdmin';<br />
|
||||||
</tt>
|
</tt>
|
||||||
@@ -688,7 +693,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
then manually fill this table with information about the table
|
then manually fill this table with information about the table
|
||||||
positions on the PDF schema.
|
positions on the PDF schema, and/or the display field.
|
||||||
</li>
|
</li>
|
||||||
</ul><br />
|
</ul><br />
|
||||||
See also this <a class="navigation" href="#faqpdf">usage tip.</a>
|
See also this <a class="navigation" href="#faqpdf">usage tip.</a>
|
||||||
@@ -1732,14 +1737,13 @@ $cfg['PmaAbsoluteUri'] = (!empty($HTTPS) ? 'https' : 'http') . '://'
|
|||||||
master_field varchar(64) NOT NULL default '',<br />
|
master_field varchar(64) NOT NULL default '',<br />
|
||||||
foreign_table varchar(64) NOT NULL default '',<br />
|
foreign_table varchar(64) NOT NULL default '',<br />
|
||||||
foreign_field varchar(64) NOT NULL default '',<br />
|
foreign_field varchar(64) NOT NULL default '',<br />
|
||||||
foreign_display_field varchar(64) NOT NULL default '',<br />
|
|
||||||
pdf_page_number int(11) NOT NULL default '0',<br />
|
pdf_page_number int(11) NOT NULL default '0',<br />
|
||||||
PRIMARY KEY (master_table,master_field),<br />
|
PRIMARY KEY (master_table,master_field),<br />
|
||||||
KEY pdf_page_number (`pdf_page_number`)<br />
|
KEY pdf_page_number (`pdf_page_number`)<br />
|
||||||
) TYPE=MyISAM;<br />
|
) TYPE=MyISAM;<br />
|
||||||
<br />
|
<br />
|
||||||
INSERT INTO `PMA_relation` VALUES ('persons', 'town_code', 'towns', 'town_code','description', 1);<br />
|
INSERT INTO `PMA_relation` VALUES ('persons', 'town_code', 'towns', 'town_code', 1);<br />
|
||||||
INSERT INTO `PMA_relation` VALUES ('persons', 'country_code', 'countries', 'country_code','description', 1);<br />
|
INSERT INTO `PMA_relation` VALUES ('persons', 'country_code', 'countries', 'country_code', 1);<br />
|
||||||
<br />
|
<br />
|
||||||
CREATE TABLE towns (<br />
|
CREATE TABLE towns (<br />
|
||||||
town_code varchar(5) NOT NULL default '0',<br />
|
town_code varchar(5) NOT NULL default '0',<br />
|
||||||
|
@@ -1359,13 +1359,27 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|
|||||||
$target = eregi_replace('^.*[[:space:]]+FROM[[:space:]]+`?|`?[[:space:]]*(ON[[:space:]]+[^,]+)?(WHERE[[:space:]]+.*)?$', '', $sql_query);
|
$target = eregi_replace('^.*[[:space:]]+FROM[[:space:]]+`?|`?[[:space:]]*(ON[[:space:]]+[^,]+)?(WHERE[[:space:]]+.*)?$', '', $sql_query);
|
||||||
$tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')';
|
$tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')';
|
||||||
|
|
||||||
$local_query = 'SELECT master_field, foreign_table, foreign_field, foreign_display_field'
|
$local_query = 'SELECT master_field, foreign_table, foreign_field'
|
||||||
. ' FROM ' . PMA_backquote($cfg['Server']['relation'])
|
. ' FROM ' . PMA_backquote($cfg['Server']['relation'])
|
||||||
. ' WHERE master_table IN ' . $tabs;
|
. ' WHERE master_table IN ' . $tabs;
|
||||||
$result = @mysql_query($local_query);
|
$result = @mysql_query($local_query);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
while ($rel = mysql_fetch_row($result)) {
|
while ($rel = mysql_fetch_row($result)) {
|
||||||
$map[$rel[0]] = array($rel[1], $rel[2], $rel[3]);
|
|
||||||
|
// check for display field?
|
||||||
|
if (!empty($cfg['Server']['table_info'])) {
|
||||||
|
$ti_query = 'SELECT display_field'
|
||||||
|
. ' FROM ' . $cfg['Server']['table_info']
|
||||||
|
. ' WHERE table_name = \'' . $rel[1] . '\'';
|
||||||
|
$result_ti = @mysql_query($ti_query);
|
||||||
|
if ($result_ti) {
|
||||||
|
list($display_field) = mysql_fetch_row($result_ti);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$display_field = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$map[$rel[0]] = array($rel[1], $rel[2], $display_field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end 2b
|
} // end 2b
|
||||||
|
Reference in New Issue
Block a user