|
|||
Help in query..
hi..
i got a little prob here.. as im still new to 'php world'.. i have question about mysql query.. okie.. i had to make a web form, and it has 4 tables which is Report, const_acc, const_location dan Position. const_acc,const_location and Position are tables with checkboxes.. all tables have the same primary key (ID)<--auto increment. Report table has the all main information on the form. the form need a 'Search' button for const_acc. the question is: how im gonna query out const_acc along with all the information link to it in Report, const_location and position?? (do u guys even understand?? haha .. my english sucks.. )id learned only basic of php.. so, i knew that it would be something like this right? PHP Code:
i tried to search how to create the query in php manual.. but failed.. if anyone have link/source on how to do it..it will be helpful.. or you can just help me directly.. hahakalu ade sape2 yg nk bls dlm bm pn boleh je.. lagi baik.. hehe |
|
||||
1st of all, i would like to know if it is necessary to use 4 tables for those coz if i m not wrong and if i happen to understand wat u wan, they wan u doin it doesnt seems to b right.
====================== i give an example of a basic form here for reference: Form : Name, Tel, Email, Address. for this i will create only 1 table which is let say: reg_table now the reg_table will have followings element : reg_id, reg_name, reg_tel, reg_email, reg_add now with this u can display all the infos as easy as pancake with just "SELECT * FROM reg_table" and if u wan u can add the condition to filter ![]() ========================= the way u do it is still workable, but u need to have a foreign key to link all the 4 tables together which appears to be quite troublesome. so hope this does really help u ![]()
__________________
Boonage - Freedom is Everything |
|
|||
At first, i did only 1 table for those.. but it quite difficult coz i have checkboxes to select.. in order to insert multiple values from checkboxes into table, i have to separate them(checkboxes table) right??
for example.. this is the code for my checboxes insert. PHP Code:
I still had problem with inserting data into Report table.. as i post the problem before... but no prob with checboxes inserting.. Really need help for this.. |
|
||||
mayb it would be helpful if u could provide a screenshot or a testsite to see on how's ur form looks like
![]()
__________________
Boonage - Freedom is Everything |
|
|||
This is my form..
i cant post an attachment, so i just could post the form separately(the codes were too long to post).. the 1st half of the form: PHP Code:
|
|
|||
continue from the first code(above).. PHP Code:
|




.. my english sucks..
)
or you can just help me directly.. haha




