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?
how to make transaction tables
Collapse
X
-
Make use of CREATE TABLE script to create a table. Something like this:Originally posted by hazahafizi 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?
[code=mysql]
create table table_name(col1 ,col2,col3....) ;
[/code] -
HiOriginally posted by hazahafizi 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?
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
Comment