I beleive the idea of altering the table structure on the fly is great, so you dont have to mess with mysql all the time, altering tables, or dropping them and create new ones...(Bold is mine) You either think that altering the table is a great idea, or that it's a complete mess. And you're right in the second case.
What Fletch meant<stroke>, I think,</stroke> is that you should have a table with two columns: one for the name of the page, and the other for the associated counter. Something like this:
This way, each new page is just a new record in this table, which you can do with a simple INSERT.+----------+---------+ | pagename | counter | +----------+---------+ | home | 123 | | page_1 | 22 | | page_2 | 16 | | credits | 2 | | policy | 1 | +----------+---------+
Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re^3: Making an automatic counter adder for all webpages
by polettix
in thread Making an automatic counter adder for all webpages
by Nik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |