Any chance this looks close. For Stage 1
//
[feedback]
feedback.ID_feedback = "$ID_feedback"
__sql__ = "select * from client where Idclient = '$client_ref' "
[flags]
flags.IDflag ="$IDflag"
//
Stage 1 What we need to do is select Client last name, city,etc. then drill down to one client and see if he/she has had any feedback entered.
Stage 2 If the client is found offer the user the chance to enter feedback. Or if not found enter a new client (but tag it with the users ID for security reasons)
Table A: is "client" 8million records
Table B: is "feedback" only a few for testing
Table A:
//
client
Field Type Null Default Comments
Idclient int(11) No
FirstName varchar(25) Yes NULL
LastName varchar(25) Yes NULL
StreetAddress varchar(40) Yes NULL
Address2 varchar(25) Yes NULL
City varchar(25) Yes NULL
Province varchar(2) Yes NULL
Postcode varchar(7) Yes NULL
Phone varchar(14) Yes NULL
Cellphone varchar(14) Yes NULL
Email varchar(25) Yes NULL
Updated date Yes NULL as been altered
updatedby int(11) No who updated this user #
Indexes: Documentation
Keyname Type Unique Packed Field Cardinality Collation Null Comment
PRIMARY BTREE Yes No Idclient 8621724 A
LastName BTREE No No LastName 538857 A YES
Phone BTREE No No Phone 8621724 A YES
Postcode BTREE No No Postcode 431086 A YES
Province BTREE No No Province 11 A YES
//
Table B:
//
feedback
Field Type Null Default Comments
ID_feedback int(11) No Just the auto inc record number
client_ref int(11) No This field is the same as client.Idclient
author int(11) No who rated this client
authorcompany varchar(50) No who name feedbacking
FBrate int(1) No 1=pos 2=neutral 3=negitive feedback rate
FBcomment mediumtext No Comment made about the client
FB_date date No Date comment made
LastUpdate date No Date comment Changed
customergrade int(2) No General Interaction Grade
FBlastname varchar(25) No Client LastName
FBphone varchar(14) No Client Phone number
FBcity varchar(25) No The Clients City or Area
Indexes: Documentation
Keyname Type Unique Packed Field Cardinality Collation Null Comment
PRIMARY BTREE Yes No ID_feedback 7 A
author BTREE No No author 0 A
FBrate BTREE No No FBrate 0 A
FBlastname BTREE No No FBlastname 0 A
FBphone BTREE No No FBphone 0 A
client_ref BTREE No No client_ref 0 A
//