- search a database
- browse results
Buttons "Edit" and "Delete" in front of each found
record are replaced with question marks; tooltip on
both question marks says: "You should define a primary
key for this table", but the records are belonging to a
table with a propperly defined primary key.
WinNT 4 SP6:
- phpMyAdmin 2.6.0-alpha2
- Apache 2.0.44
- PHP 4.3.5
- MySQL 4.0.17
Win98SE:
- Mozilla 1.7 RC1
Bye,
Peter
Logged In: YES
user_id=192186
Doesn't this happen also when browsing that table?
Logged In: YES
user_id=573985
Browsing this particular table = OK;
Searching only this particular table, results are displayd
WITH "Edit" & "Delete" Buttons.
Logged In: YES
user_id=192186
Can you post here structure of this table?
Logged In: YES
user_id=573985
CREATE TABLE address (
id mediumint(5) unsigned NOT NULL auto_increment,
titel enum('Familie','Frau','Frau Dipl.Med.','Frau
Dipl.Psych.','Frau Dr.','Frau oder Herr','Frau oder Herr
Dr.','Frau und Herr','Herr','Herr Dipl.Ing.','Herr
Dr.','Herr Dr.Ing.','Herr Dr.jur.','Herr Dr.med.','Herr
Dr.rer.nat.','Herr Ing.','Herr Mag.','Herr Prof.','Herr
Prof.Dr.','Herr Prof.Dr.med.','Herr Prof.Mag.','Herr
SR','Mr.','Mrs.','Sr.') default NULL,
vnam varchar(48) default NULL,
nnam varchar(48) default NULL,
inst varchar(64) default NULL,
abt varchar(64) default NULL,
str varchar(64) default NULL,
land varchar(4) default 'D',
plz varchar(10) default NULL,
ort varchar(64) default NULL,
t_prim varchar(32) default NULL,
t_sek varchar(32) default NULL,
t_mob varchar(32) default NULL,
t_fax varchar(32) default NULL,
email varchar(64) default NULL,
anrede varchar(48) default NULL,
s1 varchar(32) default NULL,
s2 varchar(32) default NULL,
lkdnum varchar(32) default NULL,
ustid varchar(32) default NULL,
buland
enum('BB','BE','BW','BY','HB','HE','HH','MV','NS','NW','RP','SA','SH','SL','SN','TH')
default NULL,
s4 varchar(32) default NULL,
s5 varchar(32) default NULL,
s6 varchar(32) default NULL,
ent_date date default NULL,
ent_by enum('as','hc','me','ve','zr','cl','w','uh')
default NULL,
mod_date date default NULL,
mod_by enum('as','hc','me','ve','zr','cl','w','uh')
default NULL,
mod_why varchar(200) default NULL,
remarks varchar(200) default NULL,
geb date default NULL,
PRIMARY KEY (id),
KEY titel (titel),
KEY vnam (vnam),
KEY nnam (nnam),
KEY inst (inst),
KEY str (str),
KEY plz (plz),
KEY ort (ort)
) TYPE=MyISAM PACK_KEYS=0 COMMENT='Adressen';
Logged In: YES
user_id=473563
This happens always because in a DB-search generated query like:
SELECT `username` , `password` , `authorid` ,
`mail_comments` , `mail_trackbacks` , `email` , `userlevel`
FROM `usrdb_superdbl_site`.`serendipity_authors`
WHERE `username`
LIKE '%garvin%' OR `password`
LIKE '%garvin%' OR `authorid`
LIKE '%garvin%' OR `mail_comments`
LIKE '%garvin%' OR `mail_trackbacks`
LIKE '%garvin%' OR `email`
LIKE '%garvin%' OR `userlevel`
LIKE '%garvin%' LIMIT 0 , 30
The unique query's primary key is the whole WHERE structure
instead of the real primary key (here: authorid).
I guess the detection routine for the primary key fails?
Logged In: YES
user_id=192186
garvin: I'm working on this :-). There are two problems:
- select query is generated too much complicated - no need
to list fields
- query for editing is not generated according to primary
key, but counts also with current where expression
Logged In: YES
user_id=192186
Hmm, it's not about primary key, but about keeping current
query in url...
Version I just commited into CVS will generate simple SELECT
query for this case, so it should work fine (but you won't
return back to original query).
Logged In: YES
user_id=356859
This bug isn't completely fixed in the actual CSV. Try to
execute something like this:
select * from konto where 1 and 1 and 1 and 1 and 1 and 1
and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1
and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1
and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1
and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1 and 1
In the result set, the delete buttons disapear.
Try to make the query a lot longer. Now both edit and delete
buttons disapear.
That's because in common.lib.php when calling
PMA_linkOrButton() the 4th parameter (allow_button) is
FALSE. (I do not understand why it is set to FALSE so I'm
unable to deliver a patch.)
In any case, the error message shown is completely wrong. It
says "PRIMARY KEY missing" but there is no check if there is
really a primary key or not. The check is: if the request
URI is to long.
Logged In: YES
user_id=192186
There can not be button, because we're inside other form
(for multi row edit/delete) and html does not allow nested
forms.
I decreased limit for truncating query, hope it will be fine
now for most cases.