Posted by Michael Fesser on 02/27/07 20:46
..oO(kennthompson@gmail.com)
>On Feb 27, 10:27 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>>
>> What happens if you do the following:
>>
>> function fms_get_info($tableName)
>> {
>> $sql = "select * from $tableName";
>> [...]
>
>No. That's exactly the way I was trying to do it.
Then it would work, assuming that $tableName contains a proper table
name.
>MySQL doesn't accept
>a table name passed into a function this way.
It doesn't matter whether the table name is hard-wired or stored in a
variable. The final query string as seen by MySQL will be the same.
>There must be some
>hidden mysql code that I'm unaware of.
Nope. Just make use of the error reporting features that PHP/MySQL
offer.
Micha
Navigation:
[Reply to this message]
|