how to make transaction tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hazahafiz
    New Member
    • Feb 2007
    • 14

    how to make transaction tables

    i want to make transaction tables to store transaction payment between buyer tables and seller tables. the transaction tables include trans_ID,sell_I D,buy_ID,produc t_ID,datetime,t otal_payment,pa yment_method.so , how to create it?
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by hazahafiz
    i want to make transaction tables to store transaction payment between buyer tables and seller tables. the transaction tables include trans_ID,sell_I D,buy_ID,produc t_ID,datetime,t otal_payment,pa yment_method.so , how to create it?
    Make use of CREATE TABLE script to create a table. Something like this:

    [code=mysql]

    create table table_name(col1 ,col2,col3....) ;

    [/code]

    Comment

    • yasmine
      New Member
      • Feb 2008
      • 64

      #3
      Originally posted by hazahafiz
      i want to make transaction tables to store transaction payment between buyer tables and seller tables. the transaction tables include trans_ID,sell_I D,buy_ID,produc t_ID,datetime,t otal_payment,pa yment_method.so , how to create it?
      Hi
      first u have to create the transaction payment table by using CREATE TABLE command. The trans_id field should be a primary key with auto_increment property.

      Then, u can insert values from the master tables by executing insert query as

      [CODE=mysql]insert into trans_payment(s ell_id,buy_id,p roduct_id,total _pay, pay_method) values(select a.sell_id, b.buy_id, a.product_id, a.total_pay,a.p ay_method from seller a, buyer b where a.sell_id=b.sel l_id)[/CODE]

      change the above query with ur corresponding fieldnames and referencekey fields.
      hope it'll works.....

      Comment

      Working...