Redirect Master/Detail Woes! |
9/3/2008 10:13:50 AM |
PHPRunner General questions | |
N
nix386 author
Hi there, just wondering if someone can point me in the direction as I have nearly lost all hope of resolving this myself. I think I have searched nearly every post regarding master detail redirection and yet this still eludes me.
|
|
L
|
laurent 9/3/2008 |
Hi Nick, |
N
|
nix386 author 9/3/2008 |
Hi Nick, Remark: To put it simply you want to create a (1:0) Master-Detail relationship: 1 record Master table correspond 0 or 1 Detail record. 1 record Detail Table must have 1 record Master Table Have a look at: Cardinality in Database Relationships Cheers,
|
J
|
Jane 9/4/2008 |
Nick, global $conn; if (@$_REQUEST["masterkey1"]) { $str = "select * from `detail table` where code=".$_REQUEST["masterkey1"]; $rs = db_query($str,$conn); if ($data = db_fetch_array($rs)) { //record exist header("detail_table_view.php?editid1=".$data["tid"]); exit(); } else { //there is no record for selected master record header("detail_table_add.php?mastertable=master_table&masterkey1=".$_REQUEST["masterkey1"]); exit(); } } |
N
|
nix386 author 9/4/2008 |
Jane, I think I love you! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=32704&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> global $conn; |