This topic is locked

Unknown column 'first_name' in 'field list'

5/27/2016 10:33:53 PM
PHPRunner General questions
C
cjsaputo author

Fields from table1 passed to add screen for table2. I passed the fields using $value command on a custom code link from a list screen. I use $_GET["firstname"] on the add screen. This is working but when I try to save the new record for table2 I get the error message in the topic title. These fields passed to the add screen are not actually fields in table2. I have tried making them read only on the javascript on load event but that did not work.
How can I display these fields on the add screen without allowing the save button to try to save them?

admin 5/31/2016

Use a code snippet to display those values passed via URL.

lefty 5/31/2016



Use a code snippet to display those values passed via URL.



Post Your code . You may have mismatch in the database of the fields posted to the add screen. Also post the error message And is this field based on any dropdown above it?

You have to add your link to the correct fields in the URL.
Custom Code field in table 1 field for first name link : example see below
$value = "<a href='Table2_add.php?fieldintable1=".$data["firstname"]." '>Link to Table 2 Add Page</a>";
The $_GET["firstname"] default value is correct on add page in table 2
Look at the single quote after firstname field that seems to mess everyone up . I have had this before.
If you don't want to save the field then see this link http://xlinesoft.com/asprunnernet/docs/deletefield.htm