Re: Trouble passing mysql table name to php function and using it!
- From: Michael Fesser <netizen@xxxxxx>
- Date: Tue, 27 Feb 2007 21:46:47 +0100
..oO(kennthompson@xxxxxxxxx)
On Feb 27, 10:27 am, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> 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
.
- Follow-Ups:
- Re: Trouble passing mysql table name to php function and using it!
- From: kennthompson
- Re: Trouble passing mysql table name to php function and using it!
- References:
- Trouble passing mysql table name to php function and using it!
- From: kennthompson
- Re: Trouble passing mysql table name to php function and using it!
- From: Jerry Stuckle
- Re: Trouble passing mysql table name to php function and using it!
- From: kennthompson
- Trouble passing mysql table name to php function and using it!
- Prev by Date: Re: re-using variables
- Next by Date: Re: Site search classes?
- Previous by thread: Re: Trouble passing mysql table name to php function and using it!
- Next by thread: Re: Trouble passing mysql table name to php function and using it!
- Index(es):