php -a 5 (1429237428) 6 (1429237651) 7 (1429285394) 8 (1429286366) 9 (1429304741) 10 (1429304887)
php -f migrate.php Parse error: syntax error, unexpected '%', expecting ')' in /home/habitatnashville/habitatnashville.org/me1.php on line 6
| <?php | |
| function convert($string) { | |
| return strtotime($string); | |
| } | |
| $mysqli = mysqli_connect("osx", 'my_user', 'my+p1', 'my_host'); | |
| $res = mysqli_query($mysqli, "SELECT donationId, donationDate, donationTime from GeneralDonations where donationTime IS NULL"); | |
| // while ($row = mysqli_fetch_assoc($res)) { | |
| // $row['donationTime'] = strtotime($row['donationDate']); | |
| while ($row = mysqli_fetch_assoc($res)) { | |
| printf('%sswft (%s)\n', $row[‘donationId’], $row[‘donationTime’]); | |
| $sql = "UPDATE GeneralDonations SET donationTime=" . strtotime($row['donationDate']) . "WHERE donationId =" . $row['donationId']); | |
| echo $sql; | |
| if (mysqli_query($mysqli, $sql)) { | |
| echo "Record updated successfully"; | |
| } else { | |
| echo "Error: " . mysqli_error($mysqli); | |
| } | |
| mysqli_close($mysqli); | |
| } | |
| ?> |