Hey, so i have a table on my page as a result of this code:
$result = mysql_query("Select * from porders, porders_detail, parts where porders.order_no = porders_detail.order_no and porders_detail.om_part_no = parts.om_part_no") or die(mysql_error());
This query gets fired off at the start. But i want to display a dropdown and using jQuery have an "On change" include the value of the dropdown into the mysql query above and re-display the results in the table that i talked about at the start?
Any ideas?
Just to clarify i can do the whole jquery bit, its just advice on what php to put so it does display the table at the start but i also have the option to re-send the query with included dropdown value.
I would try using the jquery ajax functions and load a php file that connects to the mysql database and brings back information based on the string entered in the textbox and have an onclick event on the list items that triggers the start of the script.
Maybe you're looking for json_encode or something like this?
http://www.php.net/manual/en/function.json-encode.php
You can transform the resultset of your query into JSON, then write it to the PHP output, and with jQuery fill the dropdown values.
In the dropdown's OnChange event, you should re-call the PHP with $.get() or something.