Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- //.. your codes like connection & ...
- // my_table is your table name.
- $query = mysql_query("SELECT * FROM my_table");
- $stored = array();
- $i = 0;
- while($row = mysql_fetch_assoc($query))
- {
- $stored[++$i] = date('Y-m-d H:i:s', $row["start_date"]);
- }
- mysql_query("alter table my_table modify start_date DATETIME;");
- $query = mysql_query("SELECT * FROM my_table");
- $i = 0;
- while($row = mysql_fetch_assoc($query))
- {
- // Id is your primary key.
- mysql_query("UPDATE my_table SET start_date='" . $stored[++$i] . "' WHERE id='" . $row['id'] . "'")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement