display tables from mySQL database

display tables from mySQL database

am 19.04.2006 19:29:50 von beetleteddy

hi all, i need to display all my tables from the mySQL database in a
table on an ASP/Javascript page, each as a link, so that when clicked,
it wil open the selected table for editing. unable to do it as
dreamweaver MX is not accepting 'show tables' as a valid query. how can
i go about doing this? i'm relatively new to ASP, working on it for
only 2 months now. so any help wil be greatly appreciated. Thanx, God
bless..

Re: display tables from mySQL database

am 20.04.2006 17:38:50 von Mike Brind

Prof. Goofy wrote:
> hi all, i need to display all my tables from the mySQL database in a
> table on an ASP/Javascript page, each as a link, so that when clicked,
> it wil open the selected table for editing. unable to do it as
> dreamweaver MX is not accepting 'show tables' as a valid query. how can
> i go about doing this? i'm relatively new to ASP, working on it for
> only 2 months now. so any help wil be greatly appreciated. Thanx, God
> bless..

What is "show tables"? The name of a query? A subroutine? A function?
Show the code you are trying to use and give detailed error mesages,
whether from the page itself or from Dreamweaver. Without more
information all anyone can do is guess.

--
Mike Brind

Re: display tables from mySQL database

am 21.04.2006 20:06:16 von beetleteddy

firstly mike, sorry for having multi posted. but when i posted it, was
not aware that they all r on the same usenet group. anyways, show
tables is a query in mySQL. the easiest way for me to show all the
tables in the database is to use this query. but dreamweaver MX doesn't
accept it as a valid query. keeps telling me to enter a valid query.
but it is a very valid query and works directly on the mySQL database.
so am stuck there. secondly, dunno how to go about displaying each
table as a link, which when clicked on wil open up d table for editing.
can u suggest a link or something? thanx, God bless...

Re: display tables from mySQL database

am 21.04.2006 22:28:32 von Mike Brind

Prof. Goofy wrote:
> firstly mike, sorry for having multi posted. but when i posted it, was
> not aware that they all r on the same usenet group. anyways, show
> tables is a query in mySQL. the easiest way for me to show all the
> tables in the database is to use this query. but dreamweaver MX doesn't
> accept it as a valid query. keeps telling me to enter a valid query.
> but it is a very valid query and works directly on the mySQL database.
> so am stuck there. secondly, dunno how to go about displaying each
> table as a link, which when clicked on wil open up d table for editing.
> can u suggest a link or something? thanx, God bless...

I use Dreamweaver, but I don't use its code generating functionality,
so this is a bit of a guess, but I suspect Dreamweaver is expecting a
query to begin with SELECT, UPDATE etc, whereas "show tables" is a
saved query in the database, and Dreamweaver hasn't got a clue what you
are trying to do.

First thing I would try is to get rid of the embedded space in "show
tables", so that it reads "showtables" or "show_tables". Get into the
practice of doing this even if your database of choice allows embedded
spaces. They are a BAD thing, and will cause problems. SQL doesn't
like them at all.

Than I would try hand coding the call to the query. Javascript is not
my bag, but in VBScript, it would look like this:

<%
sql = "show_tables"
set rs = conn.execute(sql)
'conn is a valid and open connection to the db
%>

That will return a recordset called rs, which I guess will contain a
list of table names, which you can iterate through, writing each one as
a html link.

With regard to opening up each table for editing, I can't think of one
good reason why you would want to do this, but if you did, you would
have to effectively replicate the database table as an html form.

--
Mike Brind