Re: toolkits or APIs to create a web interface as a frontend to mysql



Rahul wrote:
Are there any good tools / APIs around to create quick (and possibly good looking!) web-interfaces to access only specific canned queries from a database?

Let me describe my situation: I am *not* looking for a mysql "client". For that I already use HeidiSQL and MySQLQueryBrowser and am happy. I am also *not* looking for a web based full fledged mysql client (my users wouldnt care for SQL syntax).

What I want is to create specific canned queries that users can run.

e.g. Take the querey

SELECT items, description
FROM footable
WHERE cost < 10

I might want to allow users to run this query but with aribtray choices for "cost" as 10, etc. and get a well formatted output.

Or maybe a dropdown list to select "10" from. Just buttons, forms tables etc. that can be exposed to the user and I hide the actual mysql query behind. I suppose this is a fairly routine operation on functional websites but I am a total newbiee.

Now I guess I could program the whole thing in php but rather than reinvent the wheel I was wondering what is already available?

I am afraid that is your most likely recourse.



Besides doing it from scratch has ther problems:
*My sense of color and design is pretty atrocious. I'd rather leave that to some aesthetically designed templates.
*I'd rather have something that knows what its doing and filters against SQL injection attacks etc.


That isn't hard to do and is well covered in various places..

If you make the users that apache/php runs as (SQL wise) only able to select data, you at least know that injection at the worst might simply read data you don't want it to. Less damaging perhaps than writing data to your tables..


Are there any toolkits of this sort that I can use? I am totally open to the choice of language. My basic setup is Linux+Apache+mysql


The trouble with toolkits is that they never seem to do what you want. And you are stick when it comes to fixing bugs.

I have ended up with my own..

For simple display of tabulated data the most useful thing is a display($x,$y,$text,$width,$position,$style) which uses <div>'s with absolute coordinates to position text in a box of defined width, formatted to be left, right or center justified, an using a preselected style from a a style ***.

A few other 'primitives' like 'box()' which fills a rectangular area with a styled color, and some others like 'input_box()' 'radio_box()' 'number_box()' and so on that take input and automatically generate the right form variables with a bit of javascript validation complete the basic mix.

These are not hard to write. Just sit down with coffee, paper and pencil and work out a logical approach, write the library, and get generating the forms and output displays.

If your fonts and colors are all in a style ***, you can rapidly change the styles, and if you code e.g. tables using variables for e.g. x,y coordinates, you can in effect just change those to position a while table around the screen.

I simply look at it and nudge things around till they 'look right; especially to my wife, who is a qualified graphic artist.

Also my first style *** got the response 'I am slightly colour blind, and yellow text on a green background may be our corporate colours, but I cant read it' So I went back to blue on grey, and things looked much nicer.. a simple style*** change.

As far as the actual database calls go, those are specific to each form, and apart from a little coding so that 'database_open(), database_close()' exist in the library, taking such things as the database name, user name and password from an included file (which can actually be outside the area of the apache server, for added security) I find it easiest to simply do the query and iterate through it to display the data requested.



.


Quantcast