Help getting a Session Var from the #2 Insert Record Behavior ?
Hello I have a form that is submitting data into two separate tables. It is working great, but I’m having a little difficulty on the redirect of the second insert records behavior
In the first “Insert Record” I have
<- FIRST INSERT RECORD ->
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $********;
$WA_table = "companies";
$WA_sessionName = "companies_company_id";
$WA_redirectURL = "";
So I have the redirectURL blank, and then I’m passing the $WA_sessionName down to the next “Insert Record” like this.
<- SECOND INSERT RECORD ->
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $connect1;
$WA_table = "locations";
$WA_sessionName = "WADA_Insert_locations";
$WA_redirectURL = "locations_Detail.php?location_id=".$_SESSION['WADA_Insert_locations'] ."";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "location_id";
$WA_fieldNamesStr = "status_id|company_id|rep_id|location_type_id|location_name|address|city|state|zip|phone|fax|contact_person|contact_title|contact_person_phone|contact_person_phone_ext|conatct_person_alt_phone|contact_person_email|alt_contact_person|alt_contact_person_phone|alt_contact_person_ext|alt_contact_person_email|follow_up_status_id|follow_up_date|square_foot|utility_provider|website";
$WA_fieldValuesStr = "".((isset($_POST["status_id"]))?$_POST["status_id"]:"") ."" . "|" . "".$_SESSION['companies_company_id'] ."" . "|" ……….And so on ……
My problem is this, after the 2nd Insert Record the redirect URL is returning a NULL result and I’m getting an error like this
“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1”
Because the location_id is coming back empty.
What I’m trying to do is to populate the URL so I can then go directly to the Detail page of the account that was just created.
Any Ideas?