close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Help getting a Session Var from the #2 Insert Record Behavior ?

Thread began 10/19/2012 9:03 pm by sjones435326 | Last modified 10/22/2012 10:12 am by sjones435326 | 646 views | 2 replies


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


// 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.


// 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?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...