Re: ? "SELECT TABLE" Command
| From: | Mike W. | Date: | Tue, 11 Sep 2007 03:42:03 +0000 |
| Subject: | Re: ? "SELECT TABLE" Command | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43989@lists.php.net to get a copy of this message | ||
Chris wrote (in news:46E5E782.8000104@gmail.com):
> > It is an SQL query (probably MySQL, but perhaps SQLite or possibly even
PGSQL or mSQL):
>
> The line after $query should tell you what uses it ;)
Sorry, I meant the book may have been about any of those; I was skimming through
a bunch of SQL books at that time and dont know which one I got it from.
> > $query="SELECT TABLE $tablename;";
> > if (mysql_query($query, $link)) {
> > echo($indent."The table, '$tablename', was successfully opened.<br
/>\n"); }
> >
> > To make things even stranger, it works fine in the original program that I
> > put it in (although what, if anything, it does is beyond me), but fails
> > when I try it in another program (yes, I took care of $tablename).
>
> What's the exact query that's run? Maybe $tablename contains more than just a
table name.
Nope, its just
SELECT TABLE lyrics;
> Different mysql version? Maybe it was in an older version of mysql but they
removed it.
>
> It doesn't work in mysql5 or mysql4.0, maybe it does in an older version
though.
>
> Looks like you're trying to check that the mysql user you connected as has
access to that table.
It really feels like a command I may have used in the SQLite analyzer or
something. However, Im sure I copied it from an example script in a book. I
ve put holds on all the books on PHP and (My)SQL at the library and will check
them all.
--
Mike W.