Jump to content

[SOLVED] Mysql Results Update list


anilvaghela

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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....

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.