CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Shopping Basket

Print topic Send  topic

Author Message
Chris
Posted: 06/29/2001, 6:51 AM

I am try to send the contents of the shopping basket to a designated email
address, when the user clicks a send button. I wrote this code after
reading through another post and by using the Online Store example.

This happens under after insert event

$member_id = dlookup("orders","member_id","quantity='1'");
$email = dlookup("members","email","member_id='$member_id'");
$member_login = dlookup("members","member_login","member_id='$member_id'");
$order_id = dlookup("orders","order_id","quantity='1'");
$item_id = dlookup("orders","item_id","quantity='1'");
$item_name = dlookup("items","name","item_id='$item_id'");
$quantity = dlookup("orders","quantity","quantity='1'");
$Subject = "Order Request # $order_id From $member_login";
$Body = "Item $item_name Amount $quantity";
mail("myemailhere", $Subject, $Body, "From: $email");
break;

The problem is, if the user has more than one item in their basket it only
sends the first item. How can I send all the items?

Also, is there an easier way to send the items, instead of doing 7 dlookups
to get the contents of the tables?

Thanks.

Dr. Scott R. Senay
Posted: 07/02/2001, 2:36 PM

Well the first answer is easy, very easy... Just change the first line to
read:

$member_id = dlookup("orders","member_id","quantity>'0'");

This way it gets all of them, not just orders that are quantity of 1... You
could also use >='1' which is the same...

As to your second question, you would want to use a simple look like
"for/next" or "while (dowhile/wend, etc...)/loop" to iterate through the
tables collecting info and loading it into an array and then use the array
to send the email...

Scott...


Chris <Chris@nospam.com> wrote in message
news:9hi159$m25$1@news.codecharge.com...
> I am try to send the contents of the shopping basket to a designated email
> address, when the user clicks a send button. I wrote this code after
> reading through another post and by using the Online Store example.
>
> This happens under after insert event
>
> $member_id = dlookup("orders","member_id","quantity='1'");
> $email = dlookup("members","email","member_id='$member_id'");
> $member_login =
dlookup("members","member_login","member_id='$member_id'");
> $order_id = dlookup("orders","order_id","quantity='1'");
> $item_id = dlookup("orders","item_id","quantity='1'");
> $item_name = dlookup("items","name","item_id='$item_id'");
> $quantity = dlookup("orders","quantity","quantity='1'");
> $Subject = "Order Request # $order_id From $member_login";
> $Body = "Item $item_name Amount $quantity";
> mail("myemailhere", $Subject, $Body, "From: $email");
> break;
>
> The problem is, if the user has more than one item in their basket it only
> sends the first item. How can I send all the items?
>
> Also, is there an easier way to send the items, instead of doing 7
dlookups
> to get the contents of the tables?
>
> Thanks.
>
>

Dr. Scott R. Senay
Posted: 07/02/2001, 2:43 PM

Well the first answer is easy, very easy... Just change the first line to
read:

$member_id = dlookup("orders","member_id","quantity>'0'");

This way it gets all of them, not just orders that are quantity of 1... You
could also use >='1' which is the same...

As to your second question, you would want to use a simple look like
"for/next" or "while (dowhile/wend, etc...)/loop" to iterate through the
tables collecting info and loading it into an array and then use the array
to send the email...

Scott...



Chris <Chris@nospam.com> wrote in message
news:9hi159$m25$1@news.codecharge.com...
> I am try to send the contents of the shopping basket to a designated email
> address, when the user clicks a send button. I wrote this code after
> reading through another post and by using the Online Store example.
>
> This happens under after insert event
>
> $member_id = dlookup("orders","member_id","quantity='1'");
> $email = dlookup("members","email","member_id='$member_id'");
> $member_login =
dlookup("members","member_login","member_id='$member_id'");
> $order_id = dlookup("orders","order_id","quantity='1'");
> $item_id = dlookup("orders","item_id","quantity='1'");
> $item_name = dlookup("items","name","item_id='$item_id'");
> $quantity = dlookup("orders","quantity","quantity='1'");
> $Subject = "Order Request # $order_id From $member_login";
> $Body = "Item $item_name Amount $quantity";
> mail("myemailhere", $Subject, $Body, "From: $email");
> break;
>
> The problem is, if the user has more than one item in their basket it only
> sends the first item. How can I send all the items?
>
> Also, is there an easier way to send the items, instead of doing 7
dlookups
> to get the contents of the tables?
>
> Thanks.
>
>

Chris
Posted: 07/03/2001, 7:21 AM

That would work, but what I'm looking for is some way to only check for
orders from the member_id of the person who is submitting an order. Instead
of doing a quantity lookup, do a member_id lookup and use that id to build a
string for an order. Does that make sense? The problem I am having is that
with the quantity > 0 is that the query finds the first member_id that has
an item in their basket and outputs that member_id, whereas its not
necessarily the member who submitted an order.

Codecharge generated code that used $fldmember_id and other variables in
order to display the users data at the top of the shopping cart. But when I
try and use their variables I get blank output.

Ex:
$member_login =
dlookup("members","member_login","member_id='$fldmember_id'");
$order_id = dlookup("orders","order_id","member_id='$fldmember_id'");
$item_id = dlookup("orders","item_id","member_id='$fldmember_id'");
$item_name = dlookup("items","name","item_id='$item_id'");
$quantity = dlookup("orders","quantity","member_id='$fldmember_id'");
$Subject = "Order Request # $order_id From $member_login";
$Body = "Item $item_name Amount $quantity";
mail("myemailhere", $Subject, $Body, "From: $fldemail");
break;



I'll try and build a loop to get more than one item from the table.
Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
news:9hqpg7$q2e$1@news.codecharge.com...
> Well the first answer is easy, very easy... Just change the first line to
> read:
>
> $member_id = dlookup("orders","member_id","quantity>'0'");
>
> This way it gets all of them, not just orders that are quantity of 1...
You
> could also use >='1' which is the same...
>
> As to your second question, you would want to use a simple look like
> "for/next" or "while (dowhile/wend, etc...)/loop" to iterate through the
> tables collecting info and loading it into an array and then use the array
> to send the email...
>
> Scott...
>
>
> Chris <Chris@nospam.com> wrote in message
>news:9hi159$m25$1@news.codecharge.com...
> > I am try to send the contents of the shopping basket to a designated
email
> > address, when the user clicks a send button. I wrote this code after
> > reading through another post and by using the Online Store example.
> >
> > This happens under after insert event
> >
> > $member_id = dlookup("orders","member_id","quantity='1'");
> > $email = dlookup("members","email","member_id='$member_id'");
> > $member_login =
> dlookup("members","member_login","member_id='$member_id'");
> > $order_id = dlookup("orders","order_id","quantity='1'");
> > $item_id = dlookup("orders","item_id","quantity='1'");
> > $item_name = dlookup("items","name","item_id='$item_id'");
> > $quantity = dlookup("orders","quantity","quantity='1'");
> > $Subject = "Order Request # $order_id From $member_login";
> > $Body = "Item $item_name Amount $quantity";
> > mail("myemailhere", $Subject, $Body, "From: $email");
> > break;
> >
> > The problem is, if the user has more than one item in their basket it
only
> > sends the first item. How can I send all the items?
> >
> > Also, is there an easier way to send the items, instead of doing 7
> dlookups
> > to get the contents of the tables?
> >
> > Thanks.
> >
> >
>
>

Scott R. Senay
Posted: 07/03/2001, 6:00 PM

Ah, well part of the problem is the way your referencing the variables...

$member_login=dlookup("members","member_login","member_id='" . $fldmember_id
.. "'");

In the above example what is happening is I am closing the string, appending
the field value, and then appending to that the string closure... When this
gets processed, the system inserts the value of the field into the string,
so that if the current value of "$fldmember_id" is Scott3 then what dlookup
would actually be passed is:

members, member_login, member_id='Scott3'

Allowing it to return the data you want.

The above example is based on PHP4, your actual mileage may vary... In ASP
for example you would use "&" in place of the "." to do the work of putting
things together...

Chris <Chris@nospam.com> wrote in message
news:9hske2$9i7$1@news.codecharge.com...
> That would work, but what I'm looking for is some way to only check for
> orders from the member_id of the person who is submitting an order.
Instead
> of doing a quantity lookup, do a member_id lookup and use that id to build
a
> string for an order. Does that make sense? The problem I am having is
that
> with the quantity > 0 is that the query finds the first member_id that has
> an item in their basket and outputs that member_id, whereas its not
> necessarily the member who submitted an order.
>
> Codecharge generated code that used $fldmember_id and other variables in
> order to display the users data at the top of the shopping cart. But when
I
> try and use their variables I get blank output.
>
> Ex:
> $member_login =
> dlookup("members","member_login","member_id='$fldmember_id'");
> $order_id = dlookup("orders","order_id","member_id='$fldmember_id'");
> $item_id = dlookup("orders","item_id","member_id='$fldmember_id'");
> $item_name = dlookup("items","name","item_id='$item_id'");
> $quantity = dlookup("orders","quantity","member_id='$fldmember_id'");
> $Subject = "Order Request # $order_id From $member_login";
> $Body = "Item $item_name Amount $quantity";
> mail("myemailhere", $Subject, $Body, "From: $fldemail");
> break;
>
>
>
> I'll try and build a loop to get more than one item from the table.
> Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
>news:9hqpg7$q2e$1@news.codecharge.com...
> > Well the first answer is easy, very easy... Just change the first line
to
> > read:
> >
> > $member_id = dlookup("orders","member_id","quantity>'0'");
> >
> > This way it gets all of them, not just orders that are quantity of 1...
> You
> > could also use >='1' which is the same...
> >
> > As to your second question, you would want to use a simple look like
> > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate through the
> > tables collecting info and loading it into an array and then use the
array
> > to send the email...
> >
> > Scott...
> >
> >
> > Chris <Chris@nospam.com> wrote in message
> >news:9hi159$m25$1@news.codecharge.com...
> > > I am try to send the contents of the shopping basket to a designated
> email
> > > address, when the user clicks a send button. I wrote this code after
> > > reading through another post and by using the Online Store example.
> > >
> > > This happens under after insert event
> > >
> > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > $email = dlookup("members","email","member_id='$member_id'");
> > > $member_login =
> > dlookup("members","member_login","member_id='$member_id'");
> > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > $Subject = "Order Request # $order_id From $member_login";
> > > $Body = "Item $item_name Amount $quantity";
> > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > break;
> > >
> > > The problem is, if the user has more than one item in their basket it
> only
> > > sends the first item. How can I send all the items?
> > >
> > > Also, is there an easier way to send the items, instead of doing 7
> > dlookups
> > > to get the contents of the tables?
> > >
> > > Thanks.
> > >
> > >
> >
> >
>
>

Chris
Posted: 07/05/2001, 5:56 AM

I put in the code that you wrote for the member_login, in place of what I
had. I get blank output then. Is $fldmember_id a global variable?



Scott R. Senay <drsenay@conceptech.com> wrote in message
news:9htpqk$j26$1@news.codecharge.com...
> Ah, well part of the problem is the way your referencing the variables...
>
> $member_login=dlookup("members","member_login","member_id='" .
$fldmember_id
> . "'");
>
> In the above example what is happening is I am closing the string,
appending
> the field value, and then appending to that the string closure... When
this
> gets processed, the system inserts the value of the field into the string,
> so that if the current value of "$fldmember_id" is Scott3 then what
dlookup
> would actually be passed is:
>
> members, member_login, member_id='Scott3'
>
> Allowing it to return the data you want.
>
> The above example is based on PHP4, your actual mileage may vary... In
ASP
> for example you would use "&" in place of the "." to do the work of
putting
> things together...
>
> Chris <Chris@nospam.com> wrote in message
>news:9hske2$9i7$1@news.codecharge.com...
> > That would work, but what I'm looking for is some way to only check for
> > orders from the member_id of the person who is submitting an order.
> Instead
> > of doing a quantity lookup, do a member_id lookup and use that id to
build
> a
> > string for an order. Does that make sense? The problem I am having is
> that
> > with the quantity > 0 is that the query finds the first member_id that
has
> > an item in their basket and outputs that member_id, whereas its not
> > necessarily the member who submitted an order.
> >
> > Codecharge generated code that used $fldmember_id and other variables in
> > order to display the users data at the top of the shopping cart. But
when
> I
> > try and use their variables I get blank output.
> >
> > Ex:
> > $member_login =
> > dlookup("members","member_login","member_id='$fldmember_id'");
> > $order_id = dlookup("orders","order_id","member_id='$fldmember_id'");
> > $item_id = dlookup("orders","item_id","member_id='$fldmember_id'");
> > $item_name = dlookup("items","name","item_id='$item_id'");
> > $quantity = dlookup("orders","quantity","member_id='$fldmember_id'");
> > $Subject = "Order Request # $order_id From $member_login";
> > $Body = "Item $item_name Amount $quantity";
> > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > break;
> >
> >
> >
> > I'll try and build a loop to get more than one item from the table.
> > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> >news:9hqpg7$q2e$1@news.codecharge.com...
> > > Well the first answer is easy, very easy... Just change the first
line
> to
> > > read:
> > >
> > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > >
> > > This way it gets all of them, not just orders that are quantity of
1...
> > You
> > > could also use >='1' which is the same...
> > >
> > > As to your second question, you would want to use a simple look like
> > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate through
the
> > > tables collecting info and loading it into an array and then use the
> array
> > > to send the email...
> > >
> > > Scott...
> > >
> > >
> > > Chris <Chris@nospam.com> wrote in message
> > >news:9hi159$m25$1@news.codecharge.com...
> > > > I am try to send the contents of the shopping basket to a designated
> > email
> > > > address, when the user clicks a send button. I wrote this code
after
> > > > reading through another post and by using the Online Store example.
> > > >
> > > > This happens under after insert event
> > > >
> > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > $email = dlookup("members","email","member_id='$member_id'");
> > > > $member_login =
> > > dlookup("members","member_login","member_id='$member_id'");
> > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > $Subject = "Order Request # $order_id From $member_login";
> > > > $Body = "Item $item_name Amount $quantity";
> > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > break;
> > > >
> > > > The problem is, if the user has more than one item in their basket
it
> > only
> > > > sends the first item. How can I send all the items?
> > > >
> > > > Also, is there an easier way to send the items, instead of doing 7
> > > dlookups
> > > > to get the contents of the tables?
> > > >
> > > > Thanks.
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Scott R. Senay
Posted: 07/05/2001, 6:23 PM

$fldmember_id is the form variable based on what you wrote... References to
form items need to be prefaced by $fld to use the values in them, or at
least that's what I've been doing and if you take apart any of the examples
CC just seems to work that way... You need to replace $fldmember_id with
whatever the field on the form is that you want to reference...

Scott...


"Chris" <Chris@nospam.com> wrote in message
news:9i1o69$gn$1@news.codecharge.com...
> I put in the code that you wrote for the member_login, in place of what I
> had. I get blank output then. Is $fldmember_id a global variable?
>
>
>
> Scott R. Senay <drsenay@conceptech.com> wrote in message
>news:9htpqk$j26$1@news.codecharge.com...
> > Ah, well part of the problem is the way your referencing the
variables...
> >
> > $member_login=dlookup("members","member_login","member_id='" .
> $fldmember_id
> > . "'");
> >
> > In the above example what is happening is I am closing the string,
> appending
> > the field value, and then appending to that the string closure... When
> this
> > gets processed, the system inserts the value of the field into the
string,
> > so that if the current value of "$fldmember_id" is Scott3 then what
> dlookup
> > would actually be passed is:
> >
> > members, member_login, member_id='Scott3'
> >
> > Allowing it to return the data you want.
> >
> > The above example is based on PHP4, your actual mileage may vary... In
> ASP
> > for example you would use "&" in place of the "." to do the work of
> putting
> > things together...
> >
> > Chris <Chris@nospam.com> wrote in message
> >news:9hske2$9i7$1@news.codecharge.com...
> > > That would work, but what I'm looking for is some way to only check
for
> > > orders from the member_id of the person who is submitting an order.
> > Instead
> > > of doing a quantity lookup, do a member_id lookup and use that id to
> build
> > a
> > > string for an order. Does that make sense? The problem I am having
is
> > that
> > > with the quantity > 0 is that the query finds the first member_id that
> has
> > > an item in their basket and outputs that member_id, whereas its not
> > > necessarily the member who submitted an order.
> > >
> > > Codecharge generated code that used $fldmember_id and other variables
in
> > > order to display the users data at the top of the shopping cart. But
> when
> > I
> > > try and use their variables I get blank output.
> > >
> > > Ex:
> > > $member_login =
> > > dlookup("members","member_login","member_id='$fldmember_id'");
> > > $order_id = dlookup("orders","order_id","member_id='$fldmember_id'");
> > > $item_id = dlookup("orders","item_id","member_id='$fldmember_id'");
> > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > $quantity = dlookup("orders","quantity","member_id='$fldmember_id'");
> > > $Subject = "Order Request # $order_id From $member_login";
> > > $Body = "Item $item_name Amount $quantity";
> > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > break;
> > >
> > >
> > >
> > > I'll try and build a loop to get more than one item from the table.
> > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > Well the first answer is easy, very easy... Just change the first
> line
> > to
> > > > read:
> > > >
> > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > >
> > > > This way it gets all of them, not just orders that are quantity of
> 1...
> > > You
> > > > could also use >='1' which is the same...
> > > >
> > > > As to your second question, you would want to use a simple look like
> > > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate through
> the
> > > > tables collecting info and loading it into an array and then use the
> > array
> > > > to send the email...
> > > >
> > > > Scott...
> > > >
> > > >
> > > > Chris <Chris@nospam.com> wrote in message
> > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > I am try to send the contents of the shopping basket to a
designated
> > > email
> > > > > address, when the user clicks a send button. I wrote this code
> after
> > > > > reading through another post and by using the Online Store
example.
> > > > >
> > > > > This happens under after insert event
> > > > >
> > > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > > $email = dlookup("members","email","member_id='$member_id'");
> > > > > $member_login =
> > > > dlookup("members","member_login","member_id='$member_id'");
> > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > $Body = "Item $item_name Amount $quantity";
> > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > break;
> > > > >
> > > > > The problem is, if the user has more than one item in their basket
> it
> > > only
> > > > > sends the first item. How can I send all the items?
> > > > >
> > > > > Also, is there an easier way to send the items, instead of doing 7
> > > > dlookups
> > > > > to get the contents of the tables?
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Chris
Posted: 07/12/2001, 6:32 AM

Ok, well I'm stumped. I don't know php, but I'm trying to learn it. If
anyone has gotten this to work would you mind sharing your code?

Thanks

Scott R. Senay <drsenay@conceptech.com> wrote in message
news:9i33u6$spn$1@news.codecharge.com...
> $fldmember_id is the form variable based on what you wrote... References
to
> form items need to be prefaced by $fld to use the values in them, or at
> least that's what I've been doing and if you take apart any of the
examples
> CC just seems to work that way... You need to replace $fldmember_id with
> whatever the field on the form is that you want to reference...
>
> Scott...
>
>
> "Chris" <Chris@nospam.com> wrote in message
>news:9i1o69$gn$1@news.codecharge.com...
> > I put in the code that you wrote for the member_login, in place of what
I
> > had. I get blank output then. Is $fldmember_id a global variable?
> >
> >
> >
> > Scott R. Senay <drsenay@conceptech.com> wrote in message
> >news:9htpqk$j26$1@news.codecharge.com...
> > > Ah, well part of the problem is the way your referencing the
> variables...
> > >
> > > $member_login=dlookup("members","member_login","member_id='" .
> > $fldmember_id
> > > . "'");
> > >
> > > In the above example what is happening is I am closing the string,
> > appending
> > > the field value, and then appending to that the string closure...
When
> > this
> > > gets processed, the system inserts the value of the field into the
> string,
> > > so that if the current value of "$fldmember_id" is Scott3 then what
> > dlookup
> > > would actually be passed is:
> > >
> > > members, member_login, member_id='Scott3'
> > >
> > > Allowing it to return the data you want.
> > >
> > > The above example is based on PHP4, your actual mileage may vary...
In
> > ASP
> > > for example you would use "&" in place of the "." to do the work of
> > putting
> > > things together...
> > >
> > > Chris <Chris@nospam.com> wrote in message
> > >news:9hske2$9i7$1@news.codecharge.com...
> > > > That would work, but what I'm looking for is some way to only check
> for
> > > > orders from the member_id of the person who is submitting an order.
> > > Instead
> > > > of doing a quantity lookup, do a member_id lookup and use that id to
> > build
> > > a
> > > > string for an order. Does that make sense? The problem I am having
> is
> > > that
> > > > with the quantity > 0 is that the query finds the first member_id
that
> > has
> > > > an item in their basket and outputs that member_id, whereas its not
> > > > necessarily the member who submitted an order.
> > > >
> > > > Codecharge generated code that used $fldmember_id and other
variables
> in
> > > > order to display the users data at the top of the shopping cart.
But
> > when
> > > I
> > > > try and use their variables I get blank output.
> > > >
> > > > Ex:
> > > > $member_login =
> > > > dlookup("members","member_login","member_id='$fldmember_id'");
> > > > $order_id =
dlookup("orders","order_id","member_id='$fldmember_id'");
> > > > $item_id = dlookup("orders","item_id","member_id='$fldmember_id'");
> > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > $quantity =
dlookup("orders","quantity","member_id='$fldmember_id'");
> > > > $Subject = "Order Request # $order_id From $member_login";
> > > > $Body = "Item $item_name Amount $quantity";
> > > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > > break;
> > > >
> > > >
> > > >
> > > > I'll try and build a loop to get more than one item from the table.
> > > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > > Well the first answer is easy, very easy... Just change the first
> > line
> > > to
> > > > > read:
> > > > >
> > > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > > >
> > > > > This way it gets all of them, not just orders that are quantity of
> > 1...
> > > > You
> > > > > could also use >='1' which is the same...
> > > > >
> > > > > As to your second question, you would want to use a simple look
like
> > > > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate
through
> > the
> > > > > tables collecting info and loading it into an array and then use
the
> > > array
> > > > > to send the email...
> > > > >
> > > > > Scott...
> > > > >
> > > > >
> > > > > Chris <Chris@nospam.com> wrote in message
> > > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > > I am try to send the contents of the shopping basket to a
> designated
> > > > email
> > > > > > address, when the user clicks a send button. I wrote this code
> > after
> > > > > > reading through another post and by using the Online Store
> example.
> > > > > >
> > > > > > This happens under after insert event
> > > > > >
> > > > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > > > $email = dlookup("members","email","member_id='$member_id'");
> > > > > > $member_login =
> > > > > dlookup("members","member_login","member_id='$member_id'");
> > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > break;
> > > > > >
> > > > > > The problem is, if the user has more than one item in their
basket
> > it
> > > > only
> > > > > > sends the first item. How can I send all the items?
> > > > > >
> > > > > > Also, is there an easier way to send the items, instead of doing
7
> > > > > dlookups
> > > > > > to get the contents of the tables?
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Scott R. Senay
Posted: 07/12/2001, 12:18 PM

Actually right out of the zip file the sample works just fine... I
downloaded the program, installed it, made the appropriate changes to system
using CC to reflect my server and database variables, it generate and BANG
it worked with no problems... I'd say you need to have a better
understanding of your environment and how it works within the CC realm and
you'll be fine. I will say that you are going to need to go into the
properties section and change the various tabs to reflect YOUR server, YOUR
database and etcera...

Scott...




"Chris" <Chris@nospam.com> wrote in message
news:9ik8tt$8iv$1@news.codecharge.com...
> Ok, well I'm stumped. I don't know php, but I'm trying to learn it. If
> anyone has gotten this to work would you mind sharing your code?
>
> Thanks
>
> Scott R. Senay <drsenay@conceptech.com> wrote in message
>news:9i33u6$spn$1@news.codecharge.com...
> > $fldmember_id is the form variable based on what you wrote...
References
> to
> > form items need to be prefaced by $fld to use the values in them, or at
> > least that's what I've been doing and if you take apart any of the
> examples
> > CC just seems to work that way... You need to replace $fldmember_id
with
> > whatever the field on the form is that you want to reference...
> >
> > Scott...
> >
> >
> > "Chris" <Chris@nospam.com> wrote in message
> >news:9i1o69$gn$1@news.codecharge.com...
> > > I put in the code that you wrote for the member_login, in place of
what
> I
> > > had. I get blank output then. Is $fldmember_id a global variable?
> > >
> > >
> > >
> > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > >news:9htpqk$j26$1@news.codecharge.com...
> > > > Ah, well part of the problem is the way your referencing the
> > variables...
> > > >
> > > > $member_login=dlookup("members","member_login","member_id='" .
> > > $fldmember_id
> > > > . "'");
> > > >
> > > > In the above example what is happening is I am closing the string,
> > > appending
> > > > the field value, and then appending to that the string closure...
> When
> > > this
> > > > gets processed, the system inserts the value of the field into the
> > string,
> > > > so that if the current value of "$fldmember_id" is Scott3 then what
> > > dlookup
> > > > would actually be passed is:
> > > >
> > > > members, member_login, member_id='Scott3'
> > > >
> > > > Allowing it to return the data you want.
> > > >
> > > > The above example is based on PHP4, your actual mileage may vary...
> In
> > > ASP
> > > > for example you would use "&" in place of the "." to do the work of
> > > putting
> > > > things together...
> > > >
> > > > Chris <Chris@nospam.com> wrote in message
> > > >news:9hske2$9i7$1@news.codecharge.com...
> > > > > That would work, but what I'm looking for is some way to only
check
> > for
> > > > > orders from the member_id of the person who is submitting an
order.
> > > > Instead
> > > > > of doing a quantity lookup, do a member_id lookup and use that id
to
> > > build
> > > > a
> > > > > string for an order. Does that make sense? The problem I am
having
> > is
> > > > that
> > > > > with the quantity > 0 is that the query finds the first member_id
> that
> > > has
> > > > > an item in their basket and outputs that member_id, whereas its
not
> > > > > necessarily the member who submitted an order.
> > > > >
> > > > > Codecharge generated code that used $fldmember_id and other
> variables
> > in
> > > > > order to display the users data at the top of the shopping cart.
> But
> > > when
> > > > I
> > > > > try and use their variables I get blank output.
> > > > >
> > > > > Ex:
> > > > > $member_login =
> > > > > dlookup("members","member_login","member_id='$fldmember_id'");
> > > > > $order_id =
> dlookup("orders","order_id","member_id='$fldmember_id'");
> > > > > $item_id =
dlookup("orders","item_id","member_id='$fldmember_id'");
> > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > $quantity =
> dlookup("orders","quantity","member_id='$fldmember_id'");
> > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > $Body = "Item $item_name Amount $quantity";
> > > > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > > > break;
> > > > >
> > > > >
> > > > >
> > > > > I'll try and build a loop to get more than one item from the
table.
> > > > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > > > Well the first answer is easy, very easy... Just change the
first
> > > line
> > > > to
> > > > > > read:
> > > > > >
> > > > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > > > >
> > > > > > This way it gets all of them, not just orders that are quantity
of
> > > 1...
> > > > > You
> > > > > > could also use >='1' which is the same...
> > > > > >
> > > > > > As to your second question, you would want to use a simple look
> like
> > > > > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate
> through
> > > the
> > > > > > tables collecting info and loading it into an array and then use
> the
> > > > array
> > > > > > to send the email...
> > > > > >
> > > > > > Scott...
> > > > > >
> > > > > >
> > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > > > I am try to send the contents of the shopping basket to a
> > designated
> > > > > email
> > > > > > > address, when the user clicks a send button. I wrote this
code
> > > after
> > > > > > > reading through another post and by using the Online Store
> > example.
> > > > > > >
> > > > > > > This happens under after insert event
> > > > > > >
> > > > > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > > > > $email = dlookup("members","email","member_id='$member_id'");
> > > > > > > $member_login =
> > > > > > dlookup("members","member_login","member_id='$member_id'");
> > > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > > break;
> > > > > > >
> > > > > > > The problem is, if the user has more than one item in their
> basket
> > > it
> > > > > only
> > > > > > > sends the first item. How can I send all the items?
> > > > > > >
> > > > > > > Also, is there an easier way to send the items, instead of
doing
> 7
> > > > > > dlookups
> > > > > > > to get the contents of the tables?
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Chris
Posted: 07/12/2001, 2:03 PM

I did change the settings for MY server and MY database.

The problem lies in the code I wrote. I need help with my php code. Can
you help me with the actual php coding?

Chris,


Scott R. Senay <drsenay@conceptech.com> wrote in message
news:9ikt6j$if9$1@news.codecharge.com...
> Actually right out of the zip file the sample works just fine... I
> downloaded the program, installed it, made the appropriate changes to
system
> using CC to reflect my server and database variables, it generate and BANG
> it worked with no problems... I'd say you need to have a better
> understanding of your environment and how it works within the CC realm and
> you'll be fine. I will say that you are going to need to go into the
> properties section and change the various tabs to reflect YOUR server,
YOUR
> database and etcera...
>
> Scott...
>
>
>
>
> "Chris" <Chris@nospam.com> wrote in message
>news:9ik8tt$8iv$1@news.codecharge.com...
> > Ok, well I'm stumped. I don't know php, but I'm trying to learn it. If
> > anyone has gotten this to work would you mind sharing your code?
> >
> > Thanks
> >
> > Scott R. Senay <drsenay@conceptech.com> wrote in message
> >news:9i33u6$spn$1@news.codecharge.com...
> > > $fldmember_id is the form variable based on what you wrote...
> References
> > to
> > > form items need to be prefaced by $fld to use the values in them, or
at
> > > least that's what I've been doing and if you take apart any of the
> > examples
> > > CC just seems to work that way... You need to replace $fldmember_id
> with
> > > whatever the field on the form is that you want to reference...
> > >
> > > Scott...
> > >
> > >
> > > "Chris" <Chris@nospam.com> wrote in message
> > >news:9i1o69$gn$1@news.codecharge.com...
> > > > I put in the code that you wrote for the member_login, in place of
> what
> > I
> > > > had. I get blank output then. Is $fldmember_id a global variable?
> > > >
> > > >
> > > >
> > > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > >news:9htpqk$j26$1@news.codecharge.com...
> > > > > Ah, well part of the problem is the way your referencing the
> > > variables...
> > > > >
> > > > > $member_login=dlookup("members","member_login","member_id='" .
> > > > $fldmember_id
> > > > > . "'");
> > > > >
> > > > > In the above example what is happening is I am closing the string,
> > > > appending
> > > > > the field value, and then appending to that the string closure...
> > When
> > > > this
> > > > > gets processed, the system inserts the value of the field into the
> > > string,
> > > > > so that if the current value of "$fldmember_id" is Scott3 then
what
> > > > dlookup
> > > > > would actually be passed is:
> > > > >
> > > > > members, member_login, member_id='Scott3'
> > > > >
> > > > > Allowing it to return the data you want.
> > > > >
> > > > > The above example is based on PHP4, your actual mileage may
vary...
> > In
> > > > ASP
> > > > > for example you would use "&" in place of the "." to do the work
of
> > > > putting
> > > > > things together...
> > > > >
> > > > > Chris <Chris@nospam.com> wrote in message
> > > > >news:9hske2$9i7$1@news.codecharge.com...
> > > > > > That would work, but what I'm looking for is some way to only
> check
> > > for
> > > > > > orders from the member_id of the person who is submitting an
> order.
> > > > > Instead
> > > > > > of doing a quantity lookup, do a member_id lookup and use that
id
> to
> > > > build
> > > > > a
> > > > > > string for an order. Does that make sense? The problem I am
> having
> > > is
> > > > > that
> > > > > > with the quantity > 0 is that the query finds the first
member_id
> > that
> > > > has
> > > > > > an item in their basket and outputs that member_id, whereas its
> not
> > > > > > necessarily the member who submitted an order.
> > > > > >
> > > > > > Codecharge generated code that used $fldmember_id and other
> > variables
> > > in
> > > > > > order to display the users data at the top of the shopping cart.
> > But
> > > > when
> > > > > I
> > > > > > try and use their variables I get blank output.
> > > > > >
> > > > > > Ex:
> > > > > > $member_login =
> > > > > > dlookup("members","member_login","member_id='$fldmember_id'");
> > > > > > $order_id =
> > dlookup("orders","order_id","member_id='$fldmember_id'");
> > > > > > $item_id =
> dlookup("orders","item_id","member_id='$fldmember_id'");
> > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > $quantity =
> > dlookup("orders","quantity","member_id='$fldmember_id'");
> > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > > > > break;
> > > > > >
> > > > > >
> > > > > >
> > > > > > I'll try and build a loop to get more than one item from the
> table.
> > > > > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > > > > Well the first answer is easy, very easy... Just change the
> first
> > > > line
> > > > > to
> > > > > > > read:
> > > > > > >
> > > > > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > > > > >
> > > > > > > This way it gets all of them, not just orders that are
quantity
> of
> > > > 1...
> > > > > > You
> > > > > > > could also use >='1' which is the same...
> > > > > > >
> > > > > > > As to your second question, you would want to use a simple
look
> > like
> > > > > > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate
> > through
> > > > the
> > > > > > > tables collecting info and loading it into an array and then
use
> > the
> > > > > array
> > > > > > > to send the email...
> > > > > > >
> > > > > > > Scott...
> > > > > > >
> > > > > > >
> > > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > > > > I am try to send the contents of the shopping basket to a
> > > designated
> > > > > > email
> > > > > > > > address, when the user clicks a send button. I wrote this
> code
> > > > after
> > > > > > > > reading through another post and by using the Online Store
> > > example.
> > > > > > > >
> > > > > > > > This happens under after insert event
> > > > > > > >
> > > > > > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > > > > > $email =
dlookup("members","email","member_id='$member_id'");
> > > > > > > > $member_login =
> > > > > > > dlookup("members","member_login","member_id='$member_id'");
> > > > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > > > break;
> > > > > > > >
> > > > > > > > The problem is, if the user has more than one item in their
> > basket
> > > > it
> > > > > > only
> > > > > > > > sends the first item. How can I send all the items?
> > > > > > > >
> > > > > > > > Also, is there an easier way to send the items, instead of
> doing
> > 7
> > > > > > > dlookups
> > > > > > > > to get the contents of the tables?
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Eddy
Posted: 07/12/2001, 3:25 PM

Hi Chris,
No point in wasting your time here , I will send you the code what I have
and that did the trick for me, as soon my mailserver is back up. I hope it
is usefull to you in some way.
Regards,
Eddy,


"Chris" <Chris@nospam.com> wrote in message
news:9il3bk$uc0$1@news.codecharge.com...
> I did change the settings for MY server and MY database.
>
> The problem lies in the code I wrote. I need help with my php code. Can
> you help me with the actual php coding?
>
> Chris,


Scott R. Senay
Posted: 07/12/2001, 5:14 PM

Well without knowing what the code is, or what you are trying to accomplish
I really can't help you... Why don't you let me know what your trying to do
and what if anything isn't working and we can go from there...

Scott...


"Chris" <Chris@nospam.com> wrote in message
news:9il3bk$uc0$1@news.codecharge.com...
> I did change the settings for MY server and MY database.
>
> The problem lies in the code I wrote. I need help with my php code. Can
> you help me with the actual php coding?
>
> Chris,
>
>
> Scott R. Senay <drsenay@conceptech.com> wrote in message
>news:9ikt6j$if9$1@news.codecharge.com...
> > Actually right out of the zip file the sample works just fine... I
> > downloaded the program, installed it, made the appropriate changes to
> system
> > using CC to reflect my server and database variables, it generate and
BANG
> > it worked with no problems... I'd say you need to have a better
> > understanding of your environment and how it works within the CC realm
and
> > you'll be fine. I will say that you are going to need to go into the
> > properties section and change the various tabs to reflect YOUR server,
> YOUR
> > database and etcera...
> >
> > Scott...
> >
> >
> >
> >
> > "Chris" <Chris@nospam.com> wrote in message
> >news:9ik8tt$8iv$1@news.codecharge.com...
> > > Ok, well I'm stumped. I don't know php, but I'm trying to learn it.
If
> > > anyone has gotten this to work would you mind sharing your code?
> > >
> > > Thanks
> > >
> > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > >news:9i33u6$spn$1@news.codecharge.com...
> > > > $fldmember_id is the form variable based on what you wrote...
> > References
> > > to
> > > > form items need to be prefaced by $fld to use the values in them, or
> at
> > > > least that's what I've been doing and if you take apart any of the
> > > examples
> > > > CC just seems to work that way... You need to replace $fldmember_id
> > with
> > > > whatever the field on the form is that you want to reference...
> > > >
> > > > Scott...
> > > >
> > > >
> > > > "Chris" <Chris@nospam.com> wrote in message
> > > >news:9i1o69$gn$1@news.codecharge.com...
> > > > > I put in the code that you wrote for the member_login, in place of
> > what
> > > I
> > > > > had. I get blank output then. Is $fldmember_id a global
variable?
> > > > >
> > > > >
> > > > >
> > > > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > >news:9htpqk$j26$1@news.codecharge.com...
> > > > > > Ah, well part of the problem is the way your referencing the
> > > > variables...
> > > > > >
> > > > > > $member_login=dlookup("members","member_login","member_id='" .
> > > > > $fldmember_id
> > > > > > . "'");
> > > > > >
> > > > > > In the above example what is happening is I am closing the
string,
> > > > > appending
> > > > > > the field value, and then appending to that the string
closure...
> > > When
> > > > > this
> > > > > > gets processed, the system inserts the value of the field into
the
> > > > string,
> > > > > > so that if the current value of "$fldmember_id" is Scott3 then
> what
> > > > > dlookup
> > > > > > would actually be passed is:
> > > > > >
> > > > > > members, member_login, member_id='Scott3'
> > > > > >
> > > > > > Allowing it to return the data you want.
> > > > > >
> > > > > > The above example is based on PHP4, your actual mileage may
> vary...
> > > In
> > > > > ASP
> > > > > > for example you would use "&" in place of the "." to do the work
> of
> > > > > putting
> > > > > > things together...
> > > > > >
> > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > >news:9hske2$9i7$1@news.codecharge.com...
> > > > > > > That would work, but what I'm looking for is some way to only
> > check
> > > > for
> > > > > > > orders from the member_id of the person who is submitting an
> > order.
> > > > > > Instead
> > > > > > > of doing a quantity lookup, do a member_id lookup and use that
> id
> > to
> > > > > build
> > > > > > a
> > > > > > > string for an order. Does that make sense? The problem I am
> > having
> > > > is
> > > > > > that
> > > > > > > with the quantity > 0 is that the query finds the first
> member_id
> > > that
> > > > > has
> > > > > > > an item in their basket and outputs that member_id, whereas
its
> > not
> > > > > > > necessarily the member who submitted an order.
> > > > > > >
> > > > > > > Codecharge generated code that used $fldmember_id and other
> > > variables
> > > > in
> > > > > > > order to display the users data at the top of the shopping
cart.
> > > But
> > > > > when
> > > > > > I
> > > > > > > try and use their variables I get blank output.
> > > > > > >
> > > > > > > Ex:
> > > > > > > $member_login =
> > > > > > > dlookup("members","member_login","member_id='$fldmember_id'");
> > > > > > > $order_id =
> > > dlookup("orders","order_id","member_id='$fldmember_id'");
> > > > > > > $item_id =
> > dlookup("orders","item_id","member_id='$fldmember_id'");
> > > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > > $quantity =
> > > dlookup("orders","quantity","member_id='$fldmember_id'");
> > > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > > > > > break;
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > I'll try and build a loop to get more than one item from the
> > table.
> > > > > > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > > > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > > > > > Well the first answer is easy, very easy... Just change the
> > first
> > > > > line
> > > > > > to
> > > > > > > > read:
> > > > > > > >
> > > > > > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > > > > > >
> > > > > > > > This way it gets all of them, not just orders that are
> quantity
> > of
> > > > > 1...
> > > > > > > You
> > > > > > > > could also use >='1' which is the same...
> > > > > > > >
> > > > > > > > As to your second question, you would want to use a simple
> look
> > > like
> > > > > > > > "for/next" or "while (dowhile/wend, etc...)/loop" to iterate
> > > through
> > > > > the
> > > > > > > > tables collecting info and loading it into an array and then
> use
> > > the
> > > > > > array
> > > > > > > > to send the email...
> > > > > > > >
> > > > > > > > Scott...
> > > > > > > >
> > > > > > > >
> > > > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > > > > > I am try to send the contents of the shopping basket to a
> > > > designated
> > > > > > > email
> > > > > > > > > address, when the user clicks a send button. I wrote this
> > code
> > > > > after
> > > > > > > > > reading through another post and by using the Online Store
> > > > example.
> > > > > > > > >
> > > > > > > > > This happens under after insert event
> > > > > > > > >
> > > > > > > > > $member_id = dlookup("orders","member_id","quantity='1'");
> > > > > > > > > $email =
> dlookup("members","email","member_id='$member_id'");
> > > > > > > > > $member_login =
> > > > > > > > dlookup("members","member_login","member_id='$member_id'");
> > > > > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > > > > break;
> > > > > > > > >
> > > > > > > > > The problem is, if the user has more than one item in
their
> > > basket
> > > > > it
> > > > > > > only
> > > > > > > > > sends the first item. How can I send all the items?
> > > > > > > > >
> > > > > > > > > Also, is there an easier way to send the items, instead of
> > doing
> > > 7
> > > > > > > > dlookups
> > > > > > > > > to get the contents of the tables?
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Chris
Posted: 07/13/2001, 7:02 AM

I did let you know what I was trying to do, and I told you (group) the
problems.

> > > > > > > > > > I am try to send the contents of the shopping basket to
a
> > > > > designated
> > > > > > > > email
> > > > > > > > > > address, when the user clicks a send button. I wrote
this
> > > code
> > > > > > after
> > > > > > > > > > reading through another post and by using the Online
Store
> > > > > example.
> > > > > > > > > >
> > > > > > > > > > This happens under after insert event
> > > > > > > > > >
> > > > > > > > > > $member_id =
dlookup("orders","member_id","quantity='1'");
> > > > > > > > > > $email =
> > dlookup("members","email","member_id='$member_id'");
> > > > > > > > > > $member_login =
> > > > > > > > >
dlookup("members","member_login","member_id='$member_id'");
> > > > > > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > > > > > $item_name =
dlookup("items","name","item_id='$item_id'");
> > > > > > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > > > > > $Subject = "Order Request # $order_id From
$member_login";
> > > > > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > > > > > break;
> > > > > > > > > >
> > > > > > > > > > The problem is, if the user has more than one item in
> their
> > > > basket
> > > > > > it
> > > > > > > > only
> > > > > > > > > > sends the first item. How can I send all the items?
> > > > > > > > > >
> > > > > > > > > > Also, is there an easier way to send the items, instead
of
> > > doing
> > > > 7
> > > > > > > > > dlookups
> > > > > > > > > > to get the contents of the tables?
> > > > > > > > > >
> > > > > > > > > > Thanks.

Taken from my original post.









Scott R. Senay <drsenay@conceptech.com> wrote in message
news:9ilegq$jrk$1@news.codecharge.com...
> Well without knowing what the code is, or what you are trying to
accomplish
> I really can't help you... Why don't you let me know what your trying to
do
> and what if anything isn't working and we can go from there...
>
> Scott...
>
>
> "Chris" <Chris@nospam.com> wrote in message
>news:9il3bk$uc0$1@news.codecharge.com...
> > I did change the settings for MY server and MY database.
> >
> > The problem lies in the code I wrote. I need help with my php code.
Can
> > you help me with the actual php coding?
> >
> > Chris,
> >
> >
> > Scott R. Senay <drsenay@conceptech.com> wrote in message
> >news:9ikt6j$if9$1@news.codecharge.com...
> > > Actually right out of the zip file the sample works just fine... I
> > > downloaded the program, installed it, made the appropriate changes to
> > system
> > > using CC to reflect my server and database variables, it generate and
> BANG
> > > it worked with no problems... I'd say you need to have a better
> > > understanding of your environment and how it works within the CC realm
> and
> > > you'll be fine. I will say that you are going to need to go into the
> > > properties section and change the various tabs to reflect YOUR server,
> > YOUR
> > > database and etcera...
> > >
> > > Scott...
> > >
> > >
> > >
> > >
> > > "Chris" <Chris@nospam.com> wrote in message
> > >news:9ik8tt$8iv$1@news.codecharge.com...
> > > > Ok, well I'm stumped. I don't know php, but I'm trying to learn it.
> If
> > > > anyone has gotten this to work would you mind sharing your code?
> > > >
> > > > Thanks
> > > >
> > > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > >news:9i33u6$spn$1@news.codecharge.com...
> > > > > $fldmember_id is the form variable based on what you wrote...
> > > References
> > > > to
> > > > > form items need to be prefaced by $fld to use the values in them,
or
> > at
> > > > > least that's what I've been doing and if you take apart any of the
> > > > examples
> > > > > CC just seems to work that way... You need to replace
$fldmember_id
> > > with
> > > > > whatever the field on the form is that you want to reference...
> > > > >
> > > > > Scott...
> > > > >
> > > > >
> > > > > "Chris" <Chris@nospam.com> wrote in message
> > > > >news:9i1o69$gn$1@news.codecharge.com...
> > > > > > I put in the code that you wrote for the member_login, in place
of
> > > what
> > > > I
> > > > > > had. I get blank output then. Is $fldmember_id a global
> variable?
> > > > > >
> > > > > >
> > > > > >
> > > > > > Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > > >news:9htpqk$j26$1@news.codecharge.com...
> > > > > > > Ah, well part of the problem is the way your referencing the
> > > > > variables...
> > > > > > >
> > > > > > > $member_login=dlookup("members","member_login","member_id='" .
> > > > > > $fldmember_id
> > > > > > > . "'");
> > > > > > >
> > > > > > > In the above example what is happening is I am closing the
> string,
> > > > > > appending
> > > > > > > the field value, and then appending to that the string
> closure...
> > > > When
> > > > > > this
> > > > > > > gets processed, the system inserts the value of the field into
> the
> > > > > string,
> > > > > > > so that if the current value of "$fldmember_id" is Scott3 then
> > what
> > > > > > dlookup
> > > > > > > would actually be passed is:
> > > > > > >
> > > > > > > members, member_login, member_id='Scott3'
> > > > > > >
> > > > > > > Allowing it to return the data you want.
> > > > > > >
> > > > > > > The above example is based on PHP4, your actual mileage may
> > vary...
> > > > In
> > > > > > ASP
> > > > > > > for example you would use "&" in place of the "." to do the
work
> > of
> > > > > > putting
> > > > > > > things together...
> > > > > > >
> > > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > > >news:9hske2$9i7$1@news.codecharge.com...
> > > > > > > > That would work, but what I'm looking for is some way to
only
> > > check
> > > > > for
> > > > > > > > orders from the member_id of the person who is submitting an
> > > order.
> > > > > > > Instead
> > > > > > > > of doing a quantity lookup, do a member_id lookup and use
that
> > id
> > > to
> > > > > > build
> > > > > > > a
> > > > > > > > string for an order. Does that make sense? The problem I
am
> > > having
> > > > > is
> > > > > > > that
> > > > > > > > with the quantity > 0 is that the query finds the first
> > member_id
> > > > that
> > > > > > has
> > > > > > > > an item in their basket and outputs that member_id, whereas
> its
> > > not
> > > > > > > > necessarily the member who submitted an order.
> > > > > > > >
> > > > > > > > Codecharge generated code that used $fldmember_id and other
> > > > variables
> > > > > in
> > > > > > > > order to display the users data at the top of the shopping
> cart.
> > > > But
> > > > > > when
> > > > > > > I
> > > > > > > > try and use their variables I get blank output.
> > > > > > > >
> > > > > > > > Ex:
> > > > > > > > $member_login =
> > > > > > > >
dlookup("members","member_login","member_id='$fldmember_id'");
> > > > > > > > $order_id =
> > > > dlookup("orders","order_id","member_id='$fldmember_id'");
> > > > > > > > $item_id =
> > > dlookup("orders","item_id","member_id='$fldmember_id'");
> > > > > > > > $item_name = dlookup("items","name","item_id='$item_id'");
> > > > > > > > $quantity =
> > > > dlookup("orders","quantity","member_id='$fldmember_id'");
> > > > > > > > $Subject = "Order Request # $order_id From $member_login";
> > > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > > mail("myemailhere", $Subject, $Body, "From: $fldemail");
> > > > > > > > break;
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > I'll try and build a loop to get more than one item from the
> > > table.
> > > > > > > > Dr. Scott R. Senay <drsenay@conceptech.com> wrote in message
> > > > > > > >news:9hqpg7$q2e$1@news.codecharge.com...
> > > > > > > > > Well the first answer is easy, very easy... Just change
the
> > > first
> > > > > > line
> > > > > > > to
> > > > > > > > > read:
> > > > > > > > >
> > > > > > > > > $member_id = dlookup("orders","member_id","quantity>'0'");
> > > > > > > > >
> > > > > > > > > This way it gets all of them, not just orders that are
> > quantity
> > > of
> > > > > > 1...
> > > > > > > > You
> > > > > > > > > could also use >='1' which is the same...
> > > > > > > > >
> > > > > > > > > As to your second question, you would want to use a simple
> > look
> > > > like
> > > > > > > > > "for/next" or "while (dowhile/wend, etc...)/loop" to
iterate
> > > > through
> > > > > > the
> > > > > > > > > tables collecting info and loading it into an array and
then
> > use
> > > > the
> > > > > > > array
> > > > > > > > > to send the email...
> > > > > > > > >
> > > > > > > > > Scott...
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Chris <Chris@nospam.com> wrote in message
> > > > > > > > >news:9hi159$m25$1@news.codecharge.com...
> > > > > > > > > > I am try to send the contents of the shopping basket to
a
> > > > > designated
> > > > > > > > email
> > > > > > > > > > address, when the user clicks a send button. I wrote
this
> > > code
> > > > > > after
> > > > > > > > > > reading through another post and by using the Online
Store
> > > > > example.
> > > > > > > > > >
> > > > > > > > > > This happens under after insert event
> > > > > > > > > >
> > > > > > > > > > $member_id =
dlookup("orders","member_id","quantity='1'");
> > > > > > > > > > $email =
> > dlookup("members","email","member_id='$member_id'");
> > > > > > > > > > $member_login =
> > > > > > > > >
dlookup("members","member_login","member_id='$member_id'");
> > > > > > > > > > $order_id = dlookup("orders","order_id","quantity='1'");
> > > > > > > > > > $item_id = dlookup("orders","item_id","quantity='1'");
> > > > > > > > > > $item_name =
dlookup("items","name","item_id='$item_id'");
> > > > > > > > > > $quantity = dlookup("orders","quantity","quantity='1'");
> > > > > > > > > > $Subject = "Order Request # $order_id From
$member_login";
> > > > > > > > > > $Body = "Item $item_name Amount $quantity";
> > > > > > > > > > mail("myemailhere", $Subject, $Body, "From: $email");
> > > > > > > > > > break;
> > > > > > > > > >
> > > > > > > > > > The problem is, if the user has more than one item in
> their
> > > > basket
> > > > > > it
> > > > > > > > only
> > > > > > > > > > sends the first item. How can I send all the items?
> > > > > > > > > >
> > > > > > > > > > Also, is there an easier way to send the items, instead
of
> > > doing
> > > > 7
> > > > > > > > > dlookups
> > > > > > > > > > to get the contents of the tables?
> > > > > > > > > >
> > > > > > > > > > Thanks.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.