Jump to content

On the fly type sql queries


SharkBait

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:

Pear
Apple
Plum

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...
Link to comment
https://forums.phpfreaks.com/topic/23011-on-the-fly-type-sql-queries/
Share on other sites

Archived

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

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