...

View Full Version : PHP SQL complex condition builder



zplayer
05-19-2008, 02:52 PM
I've been trawling through the web looking for a php/web based MySql condition constructer, albeit without any success! I found plenty of web apps but no php.

Basically, i want to display a visual representation of where condtitions (including the ability to add, remove and manipulate behaviours between them ie AND, OR etc).

Has anyone seen anything like this before? Im completely lost. .

syosoft
05-19-2008, 03:42 PM
I think thats called a form.

zplayer
05-19-2008, 04:07 PM
I think thats called a form.

Thank god your here in case Sherlock Holmes doesnt turn up today!:D

syosoft
05-19-2008, 04:14 PM
Not sure what else to offer. Create a form with some fields.... maybe some javascript to easily add support for complex queries? Have you tried something and you didn't like it? are you asking for code/ideas?

Because I think ideas are going to come down to, "You need a form and some fields and some javascript." This is really a UI thing.

zplayer
05-19-2008, 04:40 PM
What I didnt want to do was start it from scratch and with all the other SQL builders out there (theres loads of windows Apps out there that I found) I thought someone may have seen/done something similar in php/javascript, preferably OO php!

Adding conditions isnt to much of a problem for simple WHERE statemens (AND X = 2. . .AND XX=4), but it becomes a bit more daunting when the query has to handle the nesting of the logic and display the correct grouping (X=2 or X=3) AND (y=1 and y=2).

I will be surprised if theres no php snippets out there or someones never done it before, but I thought I'd ask anyway.

aedrin
05-19-2008, 05:03 PM
You'll probably be quite surprised then.

A lot of complex code that is created does not get posted as a snippet. When people have spent that much effort on making something work, the last thing they want to do is mess it up again to make it ready for posting.

And again, this sounds like a fun challenge that should teach you a thing or two. And it shouldn't be that hard. You mentioned nesting, so you already know how to structure things. Using javascript and some minor PHP you could create this relatively easy.

zplayer
05-19-2008, 07:32 PM
I do like a challenge but Im not sure about the 'fun' bit lol, I've started and think I now know where I'm going, so thanks for all your help.

I'm doing it all server side as my php's a lot stronger than my javascript, plus once Ive set all the elements in the object I can manipulate it how I want ie saving, loading and executing the query; OO php ftw :thumbsup:

aedrin
05-19-2008, 08:41 PM
as my php's a lot stronger than my javascript

Might be a good opportunity to improve your JavaScript. :)

dragonheart
01-11-2010, 08:44 AM
I've been trawling through the web looking for a php/web based MySql condition constructer, albeit without any success! I found plenty of web apps but no php.

Basically, i want to display a visual representation of where condtitions (including the ability to add, remove and manipulate behaviours between them ie AND, OR etc).

Has anyone seen anything like this before? Im completely lost. .

Hi.. I'm trying to do the same thing it will be helpfull if you post the solution once u find it :) 10x



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum