anilvaghela Posted August 17, 2009 Share Posted August 17, 2009 Hello guys n girls! ok another one but this one is something i have attempted to work on..... I have a form which looks up data from a mysql table. Text field: Name channel ( here you would select the name channel) The text field box also has an onchange handler which looks up the name_id, and parent_id for that channel and places this information into two other boxes. Now I want to know on the same form how or when you select a name channel from the text field it also then populates a list of all the definitions from another table into a dynamic table on the page. So basically you choose a name_ch and it uses the name_id which is unique to that name_ch and looks up all records that have defintions assigned to that name_id from another table.... query for definitions is select definitions from tbl_def where name_id ="" ..... i am have problems here and need to know exactly what to use or do.... please help!! thanks Anil Vaghela Quote Link to comment https://forums.phpfreaks.com/topic/170614-solved-mysql-results-update-list/ Share on other sites More sharing options...
kickstart Posted August 17, 2009 Share Posted August 17, 2009 Hi Not quite sure I understand the issue. I presume that name_ch is on one table and from that you get a name_id, and then use that name_id to retrieve data from another table. In which case it would appear you was a join. Something like:- SELECT b.* FROM tbl_name a INNER JOIN tbl_def b ON a.name_id = b.name_id WHERE a.name_ch = '$SomeNameChannel' However, not certain if you are unsure about how to display this data. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/170614-solved-mysql-results-update-list/#findComment-899900 Share on other sites More sharing options...
anilvaghela Posted August 17, 2009 Author Share Posted August 17, 2009 Hi Keith..... Thanks....But to draw it out.... http://linux.heavyvibesonline.com:8080/dev/ref_db/functions/add_definitions.php that is the link to the page on there 1 : you first select a name channel, this then loads up an onchange handler which then supplies hidden boxes with information about the name_id, parent_id and level which is used for posting data. 2 : You have a collapsable panel which shows the results of definitions if any for that specific channel.... as you can the list contains some of the information but i want that list to update once you choose a name channel..... i hope thats a bit more clearer.... Quote Link to comment https://forums.phpfreaks.com/topic/170614-solved-mysql-results-update-list/#findComment-899908 Share on other sites More sharing options...
kickstart Posted August 17, 2009 Share Posted August 17, 2009 Hi Looking at that it appears that your problem isn't so much with the SQL, but with the processing of the page. Looks like you need to process the page and update the "Show Results Of Definitions For The Above Channel:" section. You could do this by processing the form (ie, have a 2nd submit button with a different name, or set a hidden field to let your script know what is required and then submit the form from within onChangeHandler). Then just return the updated form (and possibly do the same again until someone presses the real submit button). This might be a good example of something to be done using Ajax (ie, you basically use javascript and a small php script to provide updated sections of the page without reloading the whole page). All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/170614-solved-mysql-results-update-list/#findComment-899951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.