close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

insert with no recordset

Thread began 2/15/2011 9:17 am by davidp420108 | Last modified 2/16/2011 12:57 pm by Jason Byrnes | 2965 views | 11 replies |

davidp420108

insert with no recordset

i am confused on how the insert works in datassist. there is no recordset defined (at least not showing in the DW behaviors screen).

My structure is a dealer_tbl with a joined table called inventory_tbl ( i think it is a left joined but not sure).

I want to insert a new record into the inventory_table but i need some data from the dealer_tbl. If i were making a recordset, i would join them and it is easy enough. but i dont understand the DA insert record. do i just make a recordset and insert to it, or do i need to create a session variable when they log in? or can i modify the following code to be a JOIN?

be prepared for me to ask a couple of follow up questions :)
thanks



<?php 
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $Auto_Sales;
$WA_table = "inventory_tbl";
$WA_sessionName = "WADA_Insert_inventory_tbl";
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = false;
$WA_indexField = "Inventory_ID";
$WA_fieldNamesStr = "Dealer_Name|Price|Make|Model|Year|Engine|Drivetrain|Transmission|Mileage|Ext_Color|Int_Color|Body_Style|VIN|Stock_Number|Description|Date_Online|Expires|pwr_windows|pwr_locks|rear_slider|DVD|3rd_seat|premium_sound|leather|bed_liner|premium_wheels|Dealer_TBL_Dealer_ID|Status|City|Contact_Phone";
Sign in to reply to this post

Dave BuchholzBeta Tester

The DA Insert Record Server Behaviour would normally be used in conjunction with a form that posts it's contents to the page the Server Behaviour is on, so typically in an admin section you will want to insert a new record so you create a form that asks for all the information you require and then use the DA Insert SB to process the info and insert it into a database. Clear ?

Sign in to reply to this post

davidp420108

yes I understand the concept of how it works. My question was how come there is no recordset on the insert record page?

I need information from a joined table,but the DA insert record seems to only let you reference one table at a time. In this case the table is "inventory_tbl" that the record is being inserted into, and I want the data from the parent table "dealer_tbl"

Do I need to create a session variable when the client logs in to capture some data from the dealer_tbl? I want to be able to reference the "dealer_folder" column in the "dealer_tbl". But the insert record seems to only look at inventory_tbl.

If creating the session variable is the option, please give me a pointer on how to do it and on which page. i.e. is it the login page or the page that a successful login directs them to?

This question is hard for me to formulate by typing so please be patient.

Sign in to reply to this post

Dave BuchholzBeta Tester

I think I see what you are asking, what I do is create a dropdown menu with the data required from the linked table as per the screenshot attached

Sign in to reply to this post

davidp420108

I think we are way off track here. thanks for your replies, but i must be on the wrong path. let me ask a different question that should solve my problem.

Could you help me with creating a session variable?

What page do I create it on? the login page? or the page your are directed to after a successful login?

show me some sample code on creating a session variable please?

thanks.

PS I do have e-cart if that helps anything

Sign in to reply to this post

Jason ByrnesWebAssist

simple code to set a session variable would like:

php:
<?php $_SESSION['sessionName'] = "Session Value"?>



but I dont think this is going to help you very much.

let me ask a few questions and maybe we can get on the same track and i can give you more complete answers.

You are asking about setting a session when the user logs in, is the dealer_tbl you are referring to in the original question being used as your user table?

what are you using for Login, Security Assist? Or the Dreamweaver Authenticate user behavior?

Sign in to reply to this post

davidp420108

I used security assist to create the login

dealer_tbl is the user table - (this is where the dealer_folder value is stored also)

I am trying to use some information, namely the dealer_folder, to use it in my path to where images are being stored. dealer_folder is auto generated when the account is made by using preg_replace[dealer_name]. Images should be stored to www.rankedontop.com/[dealer_folder]/images.

the problem i am having is accessing "dealer_folder" because the insert record behavior only "sees" the inventory_tbl, and the dealer_folder is in the dealer_tbl

thanks for your help.

even asking the question is hard. no wonder I can't figure it out :)

Sign in to reply to this post

Jason ByrnesWebAssist

OK, so on the login page, Double Click the Security Assist Authenticate User server Behavior

Click next till you get to the Third Page, on this page, you can select columns from your users table that will be store into session values on login.

Select the dealer_folder column to have it stored in a session variable that you can use in the insert record behavior.

Sign in to reply to this post

davidp420108

thanks Jason, i think this is what i was looking for. i wont be able to work on it till later, but i will reply to let you know.

David

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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

Content

rating

Layout

rating

Ease of use

rating

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