Jump to content


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


On the fly type sql queries

Recommended Posts

I am assuming its javascript I want but I'm a noob when it comes to javascript so hopefully someone can point me in the right direction.

I want to be able to create a sorta 'on the fly' type mysql queries.

I'll have a dropdown box with 'table' names in it. When a user selects a table name it will update a block beside it with the information based on a MySQL Query.

dropdown boxes would hold something like:


I would then create the MySQL query like SELECT * FROM fruit WHERE name = '{$userselectedoption}'

Then I would have a <div> block to the left of the dropdown menu that would show me the results. 

Would javascript allow me to do this (along with php to do the query) or should I look into AJAX since that is JS that can pull information from a server without refreshing the page?

I'd perfer not to have to $_POST the information and reload the page...

Share this post

Link to post
Share on other sites
For web-based applications, JS is not appropriate, due to ActiveX security restrictions; but yes, AJAX will work.

Share this post

Link to post
Share on other sites


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.