RE: [coldbox:13835] create dynamic table name

rc.qry= tblName&Gateway.getByAttributes(orderBy = rc.orderby); .tblname in this case will be Library .

This line of code will append the contents of the variables tblName to the output of the method call Gateway.getByAttributes(). (which would only work if they were both strings)

From the sound of things, that is not what you want.

Also, will the table name ALWAYS be “library”? If so, why make it dynamic? If not, are you injecting every possible gateway? And either way, hopefully you are scrubbing the tblName variable for valid values since it appear to come from the request Collection and could be maliciously manipulated.



The library will not be the only table.

Thanks guys that works. What is variables?

It is one of the built in CF scopes right?

Here is a pdf from Ray Camden that does a pretty good job explaining scopes.