|
Posted by Martin Jay on 05/19/06 02:08
In message <446ccf2f$0$757$5fc3050@dreader2.news.tiscali.nl>, Winston S.
Figueira <pneumatosppm@tiscali.nl> writes
>This is stored serverside, SQL.
>In each block, say, c13, a counter is encreased by one, AFTER the contents
>of c14-15 are moved on place to the right.
>Info in c16 is lost, and the current date/hr/min are entered in c14.
Okay Winston, perhaps this will help you:
/* Delete column 16 */
mysql_query("ALTER TABLE $table DROP COLUMN c16");
/* Column 15 becomes column 16 */
mysql_query("ALTER TABLE $table CHANGE COLUMN c15 c16 TEXT");
/* Column 14 becomes column 13 */
mysql_query("ALTER TABLE $table CHANGE COLUMN c14 c15 TEXT")
/* Column 13 becomes column 12 */
mysql_query("ALTER TABLE $table CHANGE COLUMN c13 c14 TEXT");
/* Squeeze in a new column (13) after column 12 */
mysql_query("ALTER TABLE $table ADD COLUMN c13 TEXT AFTER c12");
You will need to change "TEXT" to whatever the type of the field is.
From what you've said I guess that's going to be "INT" or "DATETIME."
And of course you will need to repeat this for each block of four
columns.
--
Martin Jay
Navigation:
[Reply to this message]
|