PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
In this code cbocnty is a selection from a previous checkbox. In my table there are 35 columns that represent years. I can't have a column year with all the variables because the table would be too large. I am trying to use $col to match to the years that the user selected and $cnty_ch in the query to represent the counties that the user selected. This is not working. How can you put variable columns into a select statement?
When you say back tics do you mean double quotes? I tried this and my page goes blank. could you show me an example. The data comes to me in very large tables already set up like this.
$query="select `ecnty`, `major`, `$col` FROM `emp_major` WHERE `ecnty`=$cnty_ch;";
if that doesn't work, you probably have some kind of sql error. Since I can't see the pg_Exec() function, I can't say what else might be causing the problem. Just make sure you're echoing out mysql_error() on a sql failure.