This topic is locked
[SOLVED]

 Edit Page Doesn't Work After Adding A Serial Number On List Page

4/29/2013 11:40:16 PM
PHPRunner General questions
M
muhdsumar author

I have added a serial number in the list page of a table using the query, such as:
SELECT

@rownum:=@rownum+1 sno, m.codeNo, m.FirstName, m.Middlename, m.Surname, m.Sex, m.Birth_Date, m.Birth_place, m.Nationality, m.LGA_Origin, m.StateOrigin

FROM tblmain m, (select @rownum:=0) r
The primary key for the table is codeNo. Insert (Add records) works well but for edit, I get an error,

Unknown column 'm.codeNo' in 'where clause'. Can someone please help?

M
muhdsumar author 4/29/2013



I have added a serial number in the list page of a table using the query, such as:
SELECT

@rownum:=@rownum+1 sno, m.codeNo, m.FirstName, m.Middlename, m.Surname, m.Sex, m.Birth_Date, m.Birth_place, m.Nationality, m.LGA_Origin, m.StateOrigin

FROM tblmain m, (select @rownum:=0) r
The primary key for the table is codeNo. Insert (Add records) works well but for edit, I get an error,

Unknown column 'm.codeNo' in 'where clause'. Can someone please help?

M
muhdsumar author 4/30/2013

I have resolved the problem by removing the alias, m on the table tblmain as in the SQL below:
SELECT

@rownum:=@rownum+1 sno, codeNo, FirstName, Middlename, Surname, Sex, Birth_Date, Birth_place, Nationality, LGA_Origin, StateOrigin

FROM tblmain , (select @rownum:=0) r