Hi everyone, I’m getting my head in a twist with something and I’d
appreciate a little help if anyone has the time…
I’m finishing off a little shopping site with a Paypal shopping cart
(driven by Mal’s of course), and I want to use the Paypal callback
feature to run a script that updates a MySQL database to mark items
as being sold.
The problem is how I go about handling the data that’s returned from
a completed Paypal sale. It comes in the following form:
Product name : 1 : 1.99 : 0 : 26
And all I care about is the last item, which is the record number.
Now, if someone buys more than one product in a transaction the data
that’s returned is delimited by a tilde, as in this example where two
items were bought in one go:
Product name : 1 : 1.99 : 0 : 26~Product name two : 1 : 2.50 : 0 : 27
I need to iterate through the data, whether it is one item or x
number of items, compiling a list of the record number from each one,
so I can then run my ‘sold’ script for each record number.
It is partly my general slight difficulty with visualising arrays
properly in my head and partly the fact that I’m somewhat distracted
by other things, but I just can’t see my way through this. Oh,
embarassing!
Can anyone see a simple way to do this, so I can get it sorted and
then spend time writing out “I must learn to handle arrays better”
1000 times?
k
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options