I have XML that stores all the client information. Whenever my PHP code runs, it inserts client data from XML into the database. Here is a table. Not all clients are websites, so I saved all the client information directly in one table called the “client”.
Customer:
customer_id int(40) primary key
CustomerAccountNumber varchar(60)
CustomerAccountName varchar(255)
AccountBalance double
InvAddressLine1 varchar(500)
Rep varchar(20)
To store the login and usernames of web clients, I have another web account table called "Web_customers" that has "CustomerAccountNumber" as the primary key.
Web_customers:
web_id int(11) primary key
UserName varchar(39)
CustomerAccountNumber varchar(39)
EmailAddress varchar(255)
Pwd varchar(70)
customer_type varchar(10)
Sample data:
customer_id CustomerAccountNumber CustomerAccountName AccountBalance InvAddressLine1 Rep
1 Accnt1 Myname1 1098 address1 Mik
2 Accnt2 Myname2 2398 address2 Richi
3 Accnt3 Myname3 2234398 address3 Santa
4 Accnt4 Myname4 2233398 address4 Den
Since I run a PHP script to continuously reload data, client_id often changes, and therefore I cannot select it as a foreign key in my other table, which is located here:
WEB_CUST:
web_id UserName CustomerAccountNumber EmailAddress Pwd customer_type
1 Accnt1 Accnt1 b@gmail.com 123 simple
2 Accnt212 Accnt2 dj@gmail.com 123 complex
3 Accnt313 Accnt2 asdj@gmail.com 123 complex
4 Accnt315 Accnt2 342j@gmail.com 123 complex
: "" "". CustomerAccountNumber WEB_CUST.
- , . "" . WEB Accnt313 Accnt2 , , Accnt2, XML "".
XML , . XML 60 000, . .
? ? , XML "" - XML ?