As YappyDog suggests, you can use mysql_list_fields() to get a list of columns in a given table and maybe use fnmatch()
to find the desired columns using wild cards. And then build your query.
i'll try this, thanks
But the real question is: why? Having lot's of similiarily named columns in a table usually indicates a design problem.
well, i am new to this, and i'd be delighted with any assistance in design
here's the deal:
every month, i get statistics for usage -- with the same category names every month
i need to do graphs and reports with these numbers which compare month to month
i thought it would be easiest to do one table and call the different columns as necessary
this is problematic because i obviously don't want to add code to the query and reports every month, and i am not sure of the best way to do this, except to do a function so i only need to edit one place
any suggestions are greatly appreciated
thanks all