[Phpmyadmin-devel] Fetch the primary key field value for each data row

Chanaka Dharmarathna pe.chanaka.ck at gmail.com
Fri Mar 23 21:54:36 CET 2012


Hi,

I am trying to do some improvements on feature request [1]. A field (let's
call it as 'picture') with mime type "mime/jpeg" is not showing th image,
if the query (execute in query window) retrieve the 'picture' field from
the table (SELECT `picture` FROM `table_name` WHERE 1) as mentioned in [1].

To display data, $where_clause is generated by the function
PMA_getUniqueCondition (in root/libraries/common.lib.php) row wisely. For a
long data like blob type, it returns $where_clause as empty string ("").
(There is conditions to check the length of the data in that function)

What I'm trying to do is, for that kind of scenarios, make the
$where_clause as "`table`.`primary_key_feild_name` =
'primary_key_value_for_corresponding_row'" (tried with hard coding & works
for me). To do this I'm going to add a new argument to
PMA_getUniqueCondition function with those two parameters (primary field
name & relevant value). And call this inside PMA_displayTableBody function
(in display_tbl.lib.php) with those values.

If the way I'm going is correct,
Is there any way to fetching out primary key field value of each row while
inside the PMA_displayTableBody function ?
Or is there global parameter which holds table meta data ?

[1]
https://sourceforge.net/tracker/index.php?func=detail&aid=3112137&group_id=23067&atid=377411

Regards !
-- 
____________________________________

Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
____________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120324/39055ec6/attachment.html>


More information about the Developers mailing list