For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > September 2007 > ? "SELECT TABLE" Command









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ? "SELECT TABLE" Command
Alec S.

2007-09-10, 7:00 pm

Hi,

I've got a PHP program I wrote a year or so ago with the oddest line of code. I
know I didn't come up with it myself; I must have adapted it from a book or
something, but I have checked all the books it could have come from and could
not find it in any of them, nor can I find any such command anywhere else. It
is an SQL query (probably MySQL, but perhaps SQLite or possibly even PGSQL or
mSQL):

$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).


Does anyone have any idea where this bizarre piece of code came from, what it
does, if it's valid, or why it works even though such a command does not even
seem to exist? This is has had me baffled for several months now.


Thanks.

--
Mike W.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com