Connecting Tech Pros Worldwide Help | Site Map

Re: wysiwyg query builder

  #1  
Old September 6th, 2008, 08:15 PM
sliverdigger
Guest
 
Posts: n/a
Greg Russell wrote:
way.
Quote:
>
Is there such a WYSIWYG thing that will allow us to create such forms to
communicate with a mysql server?
You can keep track of successive posts to iteratively build up and
tentatively display a query statement, and then "submit" the finished
query it when it looks right. You would need a form with multiple,
carefully-named submit buttons to do that.

Keep three buffers to append to:
1) chosen column names
2) table names mapped to from a data structure, as determined
by the chosen column names. A hash eliminates duplicate
table names.
3) query conditions.

Each added condition would look like: ", and x y "
Figuring out foreign-key requirements
in the general case (so it works for any arbitrary schema) is
almost impossibly difficult.

But if you roll a few kludges into the query constructor--based on
advance knowledge of your own custom designed schema--it isn't
hard at all.

$query = "select " . $columnnames . " from " . $tablenames . " where "
.. $conditions;

Now use a regular expression to strip out the first ", and" after the
"where" in the query, and then send it.


--
cut the board three times and it's still too short
  #2  
Old September 8th, 2008, 09:45 PM
Greg Russell
Guest
 
Posts: n/a

re: Re: wysiwyg query builder


On Sat, 06 Sep 2008 13:06:16 -0600, sliverdigger wrote:
Quote:
Quote:
>Is there such a WYSIWYG thing that will allow us to create such forms
>to communicate with a mysql server?
>
You can keep track of successive posts to iteratively build up and
tentatively display a query statement, and then "submit" the finished
query it when it looks right. You would need a form with multiple,
carefully-named submit buttons to do that.
I obviously didn't express the need very well, as I can make little sense
of your reply. Thank you though.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: wysiwyg query builder Greg Russell answers 9 September 9th, 2008 06:55 PM
SQL syntax question deko answers 9 November 13th, 2005 10:25 AM
editor wolfing1@yahoo.com answers 1 September 14th, 2005 10:55 PM
6 Qustions about Python: Does it do GUI? more... Will answers 8 July 18th, 2005 09:28 AM