-
Posts
31 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Male
genius_supreme's Achievements

Newbie (1/5)
0
Reputation
-
ChristianF point noted. guess will be using get method via hyperlink.
-
all this are getting too complicated for me. query result=n number of records while loop for query result fetch array $qry print button name="btn".$btn $btn++; end while loop assuming form has btn1 to btnN how do I identify which button was clicked? another way I can think off is using GET method via hyperlink for each row. I have done this before but thought of using a button would be easier.
-
I use while loop to create the buttons as well as fetch array of records. how do I use another loop to process n number of buttons where n=unknown
-
Barand I appreciate your help again but that's not what I'm looking for. I wouldn't know now many case to put in when I don't know how many record will result in the query. the form will also be generated dynamically based on number of record
-
I'm trying to have a multiple submit button (or if there is any other way) to update each row of record individually. What i want is to identify which button was clicked. The records are displayed in a table format from 3 different tables in the same database. Each row of the query printed with a submit button. Previously i was able to do it with this code <td width=\200\" align=\"center\"><input type=\"text\" name=\"adult$j\" value=\"$adult\" size=\"6\"></td> in a loop and using this on form submit if(@$_POST['submit1']) $btn=1; and so on up to $btn=6; the thing is for this i know exactly (max) how many rows would be displayed so i have set a max of 6 form submit validation using if(@$_POST['submit1']) $btn=1; to identify which button was clicked. My current task is that I wouldn't know how many rows would be displayed but I still need to know which submit button was clicked. I can still use the previous code in a loop to create the submit buttons and it worked. It printed out 1 submit button for each row of record as I wanted. I need help on the submit part coz I really don't know how to identify the "actual" submitted button. Is there a way for me to identify which button was clicked from n number of rows/button? or is there a better work around for this? each button is to update individual records based on ID and which table is it from using single sql as below. $sql="UPDATE $tbl SET MembershipNumber=$memnumber WHERE MemberID=$id"; please help me out.
-
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
great work of creative art there barand. i got your point.. thanks -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
Aahh you are right again.. 2 members with same family name.? Changed the Family name and all 120 records appear grouped by family.. Thanks a lot Barand this is now officially closed -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
i have done all the adjustment to the data(record) but still one particular name from tblmember does not print out using your code. but if i run the filter from the database (MembershipType=1) that name appears in the list. And if i use another query count(MemberName) WHERE MembershipType=1 that particular person is included in the total from table tblmember (54 records). Strange!! I have a function to count total members filtered (MembershipType=1) for each table and this is what i get tblmember - 54 tblspouse - 24 tblchildren - 42 Total=120 but total printout on the page is 119 (short of that same particular person) is there anything that i'm missing?? -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
I'm not getting the result correctly though it does filter by membership & group by family. After some manual validation check, I found that this query does displays 2repeated results from tblchildren of the same family and did miss out a few. my result :$membership=1; Actual result: tblmember=55 tblspouse=24 tblchildren=41 Total=120 but display: tblmember=51 (missed out 5) tblspouse=24 tblchildren=43 (repeat 2 and missed out 1) total=118 (including 2 repeat) my bad.. your code is good.. it was due to the data structure itself not your query.. it is simply superb. Thanks alot Barand. this is now solved. -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
I'm not getting the result correctly though it does filter by membership & group by family. After some manual validation check, I found that this query does displays 2repeated results from tblchildren of the same family and did miss out a few. my result :$membership=1; Actual result: tblmember=55 tblspouse=24 tblchildren=41 Total=120 but display: tblmember=51 (missed out 5) tblspouse=24 tblchildren=43 (repeat 2 and missed out 1) total=118 (including 2 repeat) -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
aahh.... join condition use AND not WHERE.. my bad...i've been trying with WHERE clause in join condition... anyway it did the job my friend.. mission accomplished.. thanks.. -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
You query is good but i just realized that your in query tblspouse and tblchildren depends on the where clause of tblmember for the MembershipType field. So it produces incorrect records though it was a good improvement where it grouped in families. Each table has their own MembershipType. for example a child may not be the same membership as its father and the same goes to spouse. How do I insert the where clause for each table to have MembershipType=$membership. All three tables are filtered by MembershipType=$membership then grouped by tblmember.FamilyName. Good tweak and great accomplishment. Hope you could help me more in this issue.. -
extract data from multiple table with criteria
genius_supreme replied to genius_supreme's topic in MySQL Help
all three tables has many fields but only 3 are to be selected MemberName FamilyName MembershipType MembershipType is user select from dropdown menu. The result should show the MemberName from each tables grouped by FamilyName based on the MembershipType selected by user. -
Hi phpfreaks, need help on the issue. Im trying to get records of family (tblmember,tblspouse,tblchildren) all extracted based on two fileds (FamilyName,MembershipType) where FamilyName is from the tblmember.FamilyName and MembershipType (for all three tables) is user input ($membership) i have tried all (joins) but i do not get the result that i want my code 1: SELECT tblmember.*,tblspouse.*,tblchildren.* FROM tblmember,tblspouse,tblchildren WHERE tblspouse.FamilyName=tblmember.FamilyName AND tblchildren.FamilyName=tblmember.FamilyName AND tblmember.MembershipType=$membership AND tblspouse.MembershipType=$membership AND tblchildren.MembershipType=$membership ORDER BY tblmember.FamilyName ASC code 1 returns only records from tblchildren ( which is tblchildren.MemberName field) code 2: SELECT * FROM tblchildren JOIN tblspouse ON tblchildren.FamilyName=tblspouse.FamilyName INNER JOIN tblmember ON tblmember.FamilyName=tblchildren.FamilyName WHERE tblmember.MembershipType=$membership AND tblspouse.MembershipType=$membership AND tblchildren.MembershipType=$membership ORDER BY tblmember.FamilyName ASC returns only records from tblmember for the n number of records in tblchildren (tblchildren has 37 records and the result return will be 37 number of tblmember.MemberName) Code 3: SELECT tblmember.MemberName as `a`, tblmember.MembershipType, tblmember.FamilyName, tblspouse.MemberName as `b` , tblspouse.MembershipType, tblspouse.FamilyName, tblchildren.MemberName as `c`,tblchildren.MembershipType,tblchildren.FamilyName FROM tblspouse JOIN tblmember LEFT JOIN tblchildren ON tblchildren.FamilyName=tblmember.FamilyName WHERE tblmember.MembershipType=$membership"; Code 3 somehow manage to group by family but it shows in repeated manner where tblmember.MemberName of family-1 still appear with family-2 tblspouse.MemberName and family-1 tblchildren.MemberName (and more mixed-up families). My records are displayed in tabled format where each family is group in one row. I want to display all the records from all 3 tables grouped by FamilyName where MembershipType=$membership how can i accomplish this? currently im using 3 different queries to extract first query extract from tblmember where MembershipType=$membership second query extract from tblspouse where MembershipType=$membership thrid query extract from tblchildren where MembershipType=$membership Is there a better way to combine all 3 queries into 1 which groups the result by field FamilyName? Each family members appear in the same row of the table. Hope i didn't confuse y'all
-
adding the 4th range will create a new paragraph which i don't want... unless if there is a guide on how to create 4th range at the end of 3th range then I will definitely take that option