This topic is locked
[SOLVED]

 adding record on detail table from master table

2/1/2008 4:26:33 AM
PHPRunner General questions
A
amuro author

Hi, someone advise me, please
I have 2 tables, master and detail, the primary key is id.

The user clicks hyperlink on master to link to detail and adds record, the add page is with id.

My demand is the user only can adds record by the way like above.

The left side on the browse has master and detail hyperlink, user can clicks detail table hyperlink to add record.

If like this, the add page is without primary key. I don't want user to do it.
thanks a lot <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7425&image=1&table=forumtopics' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 2/1/2008

Hi,
you can do the following:

  1. remove detail link from menu: uncheck Create menu item for this table option on the Datasource tables tab,
  2. and check master key in the Before record added event for detail table on the Events tab.

    Here is a sample:
    if (!$_REQUEST["masterkey1"])

    return false;

    else

    return true;

A
amuro author 2/1/2008

2. and check master key in the Before record added event for detail table on the Events tab.

Here is a sample:


It does not work.

In the event, I set the $message = $_REQUEST["masterkey1"] to check its value.

$_REQUEST["masterkey1"] is empty by the two way to add record.

Could any help. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=25462&image=1&table=forumreplies' class='bbc_emoticon' alt=':P' />
Thank you, Jane

J
Jane 2/4/2008

Hi,
it's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.