Jump to content

PHP and AJAX MySQL Database Problem


maweber98

Recommended Posts

I have followed the example at w3schools to use AJAX to dynamically connect to a mysql database using a PHP script and bring the content back to the page. I have everything set up in the example link below. My problem is that I want to do two seperate queries on a form and bring the information back to the page. The queries both work but the placement of the information is giving me problems. It places the results of both queries in the same <div> container. Even though the <div> containers have different ID's. http://www.coastalpet.com/testing/product_admin_st4.phpDoes anyone have any suggestions on how to get the results in the right spots on the page. Thank you!

Link to comment
Share on other sites

It's because there are two functions with the name "stateChanged" - one is in the selectcolor.js and the other is in the selectdescription.js. When you load the page, you have selectcolor.js loaded first, which loads its stateChanged function into memory. Then, after selectcolor.js has been loaded, the browser fetches selectdescription.js which loads its stateChanged function into memory - overwriting the selectcolor.js stateChanged function.The simplest solution would be to come up with two different names - perhaps colorStateChanged and descriptionStateChanged.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...