[quoted text, click to view] 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