Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 6th, 2008, 08:15 PM
sliverdigger
Guest
 
Posts: n/a
Default Re: wysiwyg query builder

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
Default 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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles