Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: wysiwyg query builder

sliverdigger
Guest
 
Posts: n/a
#1: Sep 6 '08
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

Greg Russell
Guest
 
Posts: n/a
#2: Sep 8 '08

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