Skip to content

Instantly share code, notes, and snippets.

*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: agreement
type: ref
possible_keys: PRIMARY,customer_id
key: customer_id
key_len: 4
ref: const
rows: 2
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: agreement
type: ref
possible_keys: customer_id
key: customer_id
key_len: 4
ref: const
rows: 2
SELECT count(*) FROM product1 WHERE agreement_id = :id;
-- 77924
SELECT count(*) FROM product2 WHERE agreement_id = :id;
-- 1486
SET profiling = 1; -- don't worry, it's per-session setting
SELECT 1
FROM `agreement`
LEFT JOIN `product1` ON (
`agreement`.`id`=`product1`.`agreement_id`
AND `product1`.`status` IN ('active', 'expiring')
)
LEFT JOIN `product2` ON (
`agreement`.`id`=`product2`.`agreement_id`
SELECT 1
FROM `agreement`
INNER JOIN `product1` ON (
`agreement`.`id`=`product1`.`agreement_id`
AND `product1`.`status` IN ('active', 'expiring')
)
WHERE `agreement`.customer_id = :id
LIMIT 1
SELECT 1
FROM `agreement`
LEFT JOIN `product1` ON (
`agreement`.`id`=`product1`.`agreement_id`
AND `product1`.`status` IN ('active', 'expiring')
)
LEFT JOIN `product2` ON (
`agreement`.`id`=`product2`.`agreement_id`
AND `product2`.`status` IN ('active', 'expiring')
)
@prgTW
prgTW / phpstorm_setter_method
Last active March 11, 2016 10:36
PhpStorm Setter Method
#set($typeHintSanitized = $TYPE_HINT)
## First check if attribute is nullable
#set($nullableOptions = ["null|", "null |", "|null", "| null"])
#set($typeHintSuffix = "")
#foreach($nullableOption in $nullableOptions)
#if ($typeHintSanitized.contains($nullableOption))
#set($typeHintSanitized = $typeHintSanitized.replace($nullableOption, ""))
#set($typeHintSuffix = " = null")
#end
@prgTW
prgTW / code.php
Created September 22, 2015 12:32
tr-payu-alu-error
<?php
$cfg = new MerchantConfig('OPU_TEST', 'SECRET_KEY', 'TR');
/**
* Create user with params:
*
* User IP - User's IP address
* Card Number Input Time - Time it took the user to enter credit card number in seconds
* User Time - Time of user computer - optional