MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: SQL Customers and Orders Database question



******    message to minivend-users from lee@netguide.net     ******

On Fri, 23 Apr 1999, Steve Cockwell wrote:

> ******    message to minivend-users from Steve Cockwell <stevec@sierra.lazarus.ca>     ******
>  
> So, on the receipt.html page, all I really need to do is the following:
> 
> 1.  Pull the customer number from the customer database by doing a
> SELECT WHERE customer_name = '[value fullname]'
> 2.  Insert that value into the order database as the second field while
> I am doing my [SQL type=SET etc.] operation.
> 
> If some kind soul wouldn't mind giving me some insight on how they think
> this should be done, I'd be very happpy.  I tried nesting an SQL
> statement to pull the field from the customer database inside the SET
> operation but I just got syntax errors (likely my fault).

  I am also backending a full SQL database with multiple tables for
products, orders, customer info etc into minivend.  Currently, I am doing
things like what I think you are trying to achieve above like this:

[set name=User_ID interpolate=1]
[sql type=list query="select user_id from www_user where login='[data session username]'"][sql-code][/sql]
[/set]

  Probably very ugly, but it's working for the moment until minivend gets
nicer, more powerful SQL support (or someone shows me how to do it
properly ;) ).  So you could do something similar for your tables to
return your customer number.

  You could then do your SQL SET statement using [scratch User_ID] (or
whatever you call your customer number scratch variable).

  Funnily enough, the last bit left on my site to do is the insertion of
orders into an order table keyed by order number and customer number.  I'd
be very interested in knowing how you go and maybe helping each other out
if we get stuck.

  Regards,
          Lee.

--
Lee Hamilton
Systems Administrator
lee@netguide.net


-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: