INSERT INTO dateplan
(id_tas_dat, date_dat)
VALUES
(16, '2015-09-14'),
(7, '2015-09-14'),
(8, '2015-09-14'),
(10, '2015-09-14'),
(11, '2015-09-14')
$inserts = '';
$date = $_POST['data_oper_tas'];
for ($i = 0, $i < count($_POST['check_func']); $i++)
{
$inserts .= '('. $_POST['check_func'][$i] .','. $date .'),';
}
$insertQuery = 'INSERT INTO dateplan (id_tas_dat, date_dat) VALUES ';
$mysqli = new mysqli('localhost', 'my_user', 'my_password', 'world');
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$stmt = $mysqli->prepare($insertQuery . rtrim($inserts, ','));
$stmt->execute();
$stmt->close();
UPDATE woodfun.toys_users AS w, ghujgu.toys_users AS g
SET
w.email = g.email,
w.name1 = g.name1,
w.name2 = g.name2,
и так далее
w.discount = g.discount
WHERE w.id = g.id
SELECT CURDATE() - INTERVAL CASE WHEN DAYOFWEEK(CURDATE()) = 1 THEN 13 ELSE DAYOFWEEK(CURDATE()) + 5 END DAY -- start of the previous week
SELECT CURDATE() - INTERVAL CASE WHEN DAYOFWEEK(CURDATE()) = 1 THEN 6 ELSE DAYOFWEEK(CURDATE()) - 1 END DAY -- end of the previous week
SELECT DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY) -- end of the previous month
SELECT DATE_ADD(DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY), INTERVAL - DAYOFMONTH(DATE_ADD(CURDATE(), INTERVAL - DAYOFMONTH(CURDATE()) DAY)) + 1 DAY) -- start of the previous month
UPDATE wp_posts SET post_content = REPLACE(post_content,'www.domain.com/wp-content/uploads/sites/5','www.domain.com/wp-content/uploads');
/*
exec usp_Category_Select '2'
*/
ALTER Procedure [dbo].[usp_Category_Select](
@UserID int
) as
SELECT Category.CategoryID, Category.Category, Category.UserID
FROM [Category]
WHERE Category.UserID = @UserID
/*
exec usp_Category_Select '2'
*/
ALTER Procedure [dbo].[usp_Category_Select](
@UserID int
) as
SELECT [Category].CategoryID, [Category].Category, [Category].UserID, [User].UserID
FROM [User]
INNER JOIN [Category] ON [User].UserID = [Category].UserID /* Это условие пересечения двух таблиц */
WHERE [Category].UserID = @UserID /* Это условие фильтрации по полю UserID */