Master-Detail Fancy PK is non-integer

QuestionsMaster-Detail Fancy PK is non-integer
John asked 10 years ago

Hi Abu,

I have an issue with Master detail fancy when the PK is non-integer.

According to Master-Detail Fancy,
// for non-int fields as PK
// $id = (empty($_GET["rowid"])?0:$_GET["rowid"]);

I have created a same database where the client id is non-integer e.g 1a,2b,3c
(I believe in the demo "client_id" is the PK)

and I have modified these sections

.
.
.
// receive id, selected row of parent grid
$id = (empty($_GET["rowid"])?0:$_GET["rowid"]);
$gender = $_GET["gender"];
$company = $_GET["company"];
$cid = $_GET["client_id"];
.
.
.
function add_client(&$data)
{
$id = (empty($_GET["rowid"])?0:$_GET["rowid"]);
$data["params"]["client_id"] = $id;
.
.
.

The only difference of the database is that I change the client id value into 1a,2b,3c and set it as varchar in the database.

Are my changes are correct or there are more code that I would need to put in?

Cheers
John

1 Answers
Abu Ghufran answered 10 years ago

I tested with client_id changed to alphanum, and demo works after following changes.

See diff here …
http://www.mergely.com/mev750Nt/

Copy right side code to demo and recheck.

Your Answer

16 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?