close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Getting Array session into database

Thread began 10/09/2019 8:21 pm by lr_leal239405 | Last modified 1/21/2020 9:00 am by Ray Borduin | 1025 views | 5 replies |

lr_leal239405

Trying to get Array session values into database with foreach with no success - only inserts last item of the array

Got a couple of days into trying to get this array to show in the 2nd page and then capture on database. All I get is the last line of the array. Attached are the files. I want to get the products into the confirm page and have it save to the database. I only get one line of products out of two.

This only applies to this line:
$ReplaceQuery->bindColumn("DetailItems", "s", "". implode(',',$value) ."", "WA_DEFAULT");
in the details table

You can see it by going to .com, Items in Stock - box, then, View Your Orders, then login with details below.

Make sure you add an x to the name of the file as such:

https://www..com/eCart/orders/order_historyx.php

(otherwise you'd be in the Live one).

On pressing Reorder, it goes to the form that is filled out and press submit which the Commit page handles. That's the page that won't all the rows into the db. (There's an array within an array by the way), so I'm pretty sure my logic is not very good.

You'll see all my commented out lines in my attempt to get it to work.- No Go.

Attached Files
cacfiles.zip
Sign in to reply to this post

Ray BorduinWebAssist

There is a lot of custom code and commented out code on this page. I think we would have to do a screen sharing session with a premier support ticket to hash this out and find a solution.

If $value is set correctly as an array, then it might be as simple as using:
$ReplaceQuery->bindColumn("DetailItems", "s", $value, "WA_DEFAULT");

But I'd have to do debugging and work through everything up to that point to be confident. I don't think I can do all that in the context of a forum post.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

ok. I thought so. I can call you later.

Sign in to reply to this post

lr_leal239405

what is the latest I can call you tonight (or what works for you).

It's probably going to take about 15 after I show you.

Sign in to reply to this post

Ray BorduinWebAssist

Tomorrow morning would be better... but if you try tonight I may be available. Honestly the later the better like after the kids go to bed might work.

Sign in to reply to this post
Did this help? Tips are appreciated...

lr_leal239405

I'll call you later tonight, but just to simplify what I'm trying to do is get the value of the ForEach on the order_quoted_itemx.php to the confirm_order_quoted_itemx.php and have it go to the database. I only get the last value (of session I guess) from the while loop.

(the files without the x on the name are the live files).

I cleaned up a bunch of commented out lines (which were my attempts)

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

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