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/20/2012 12:03 am by sjones435326 | Last modified 10/22/2012 1:12 pm by sjones435326 | 516 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?

Sign in to reply to this post

Jason ByrnesWebAssist

you dont need to pass the session as part of the URL variable, the whole idea of using a session is that once set, it is available to all pages.

in the locations_Detail.php page, set the recordset to use the $_SESSION['WADA_Insert_locations'] variable instead of trying to pass it through the URL.

if you continue to have problems, send a copy of both the insert and details pages in a zip archive so i can see the entire page code.

Sign in to reply to this post


Hello Jason, first of all I'm sorry that I wasted your time. After I read your post, I went to the location_Detail.php page and looked at the code. This bit of code was already there.

$ParamSessionlocation_id_WADAlocations = "-1";
if (isset($_SESSION['WADA_Insert_locations'])) {
$ParamSessionlocation_id_WADAlocations = $_SESSION['WADA_Insert_locations'];

I am unsure how that got generated, but I'm assuming that the DATAAssist Wizard had something to do with it.

I went back into the insert pages and changed the redirect from the second insert behavior to the basic URL "locations_Detail.php" and sure enough it functioned perfectly.

I first of all want to thank you for thinking of these features and making things so much easier.

I feel like an idiot for wasting three days trying to make things more complicated by sending the variable through the URL, when all I had to do is set the redirect to the details page and it was ready to go. Okay, live and learn. I'll try not to waste anymore of your time!

Sign in to reply to this post

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