Re: [PHP] MySQL: copying entire columns

2001-11-30 Thread Miles Thompson
Tom It's a relational database, field column position does not matter. One Date's 121 rules, if I remember correctly. In terms of human readability, it sometimes matters. Check the MySQL manual, I think there's an example of this under the ALTER TABLE command. But really, position doesn't

Re: [PHP] MySQL: copying entire columns

2001-11-30 Thread Tom Churm
hi, miles: i think you helped me hit on something big here. each time i've been using INSERT statements in my php code, i've been addressing the field names in exactly the order they appear in my mysql table. ie: i've been using $sql = Insert into $table_name(Name, Address, Phone)

Re: [PHP] MySQL: copying entire columns

2001-11-30 Thread Andrey Hristov
?php $which_column = 0; // starting from 0 $fname = some.csv; $out_fname = some_new.csv; $cschar = ,; $f_cont = file($fname); foreach ($f_cont as $key =$value){ $tmp = explode($cschar,trim($value)); $tmp[count($tmp)] = $tmp[$which_column]; unset($tmp[$which_column]); $out_cont[]