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