- Joined
- Mar 26, 2012
- Messages
- 1,465
- Reaction score
- 131
$hostname="SERVERNAME\SQLEXPRESS";
$dbname="User";
$username='SERVERNAME';
$password='MYPASSWORD';
$first_bind = $conn->prepare("UPDATE Account SET Birthday = '23-01-1978 00:00:00' WHERE UserID = 'test'");
$update = $first_bind->execute;
$hostname="SERVERNAME\SQLEXPRESS";
$dbname="User";
$username='SERVERNAME';
$password='MYPASSWORD';
$userId = 123;
$date = 'whatever';
$first_bind = $conn->prepare("UPDATE Account SET Birthday = :birthday WHERE UserID = :userId");
$first_bind->bindParam(':birthday', $date, PDO::PARAM_STR); // or date(...) instead of $date
$first_bind->bindParam(':userId', $userId, PDO::PARAM_STR); // or PDO::PARAM_INT if your user id is a number
$update = $first_bind->execute;