Mehmet Mutlu

28 Nisan 2011

mysql_unbuffered_query

mysql_unbuffered_query — Sonuç kümesi tamponlanmayan ve alınmayan bir SQL sorgusu gönderir

resource mysql_unbuffered_query ( string $sorgu [, resource $bağlantı_belirteci ] )

SELECT, SHOW, DESCRIBE ve EXPLAIN deyimleri için mysql_unbuffered_query() başarı durumunda bir özkaynak aksi takdirde FALSE döndürür.

UPDATE, DELETE, DROP gibi diğer SQL deyimi türlerinde, mysql_unbuffered_query() başarı durumunda TRUE aksi takdirde FALSE döndürür.

27 Nisan 2011

Uploadify & Sessions

scriptData

'scriptData': {'session_id': '<?php echo session_id();?>'}

script

<?php session_id($_REQUEST['session_id']); session_start();

Uploadify onComplete json decode

etiketler: , , , — 10:02
'onComplete' :
function(event, queueID, fileObj, response, data) {
eval("var obj1="+response);
$('div#one').html(obj1.a);
}

26 Nisan 2011

convert_smart_quotes

	function convert_smart_quotes($text){
		/*HABER METİNİN İÇİNDE OFFİCE WORLD TİPİ VİRGÜL TEK TIRNAK FİLAN DÜZENTİYOR*/
		$text = str_replace(chr(130), ',', $text);
		$text = str_replace(chr(132), '"', $text);
		$text = str_replace(chr(133), '...',$text);
		$text = str_replace(chr(145), "'", $text);
		$text = str_replace(chr(146), "'", $text);
		$text = str_replace(chr(147), '"', $text);
		$text = str_replace(chr(148), '"', $text);
		$text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
		$text = str_replace('&#286;', 'Ğ', $text);
		$text = str_replace('&#287;', 'ğ', $text);
		$text = str_replace('&Ouml;', 'Ö', $text);
		$text = str_replace('&ouml;', 'ö', $text);
		$text = str_replace('&Ccedil;', 'Ç', $text);
		$text = str_replace('&ccedil;', 'ç', $text);
		$text = str_replace('&#350;', 'Ş', $text);
		$text = str_replace('&#351;', 'ş', $text);
		$text = str_replace('&#304;', 'İ', $text);
		$text = str_replace('&#305;', 'ı', $text);
		$text = str_replace('&Uuml;', 'Ü', $text);
		$text = str_replace('&uuml;', 'ü', $text);
		$text = str_replace('&quot;', '"', $text);
		return $text;
	}

02 Nisan 2011

filter_var

<?php
// for filters that accept options, use this format
$options = array(
    'options' => array(
        'default' => 3, // value to return if the filter fails
        // other options here
        'min_range' => 0
    ),
    'flags' => FILTER_FLAG_ALLOW_OCTAL,
);
$var = filter_var('0755', FILTER_VALIDATE_INT, $options);

// for filter that only accept flags, you can pass them directly
$var = filter_var('oops', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);

// for filter that only accept flags, you can also pass as an array
$var = filter_var('oops', FILTER_VALIDATE_BOOLEAN,
                  array('flags' => FILTER_NULL_ON_FAILURE));

// callback filter
function foo($value)
{
    $ret = new stdClass;
    $ret->value = filter_var($value, FILTER_VALIDATE_BOOLEAN,
                             array('flags' => FILTER_NULL_ON_FAILURE));
    return $ret;
}
$var = filter_var('yes', FILTER_CALLBACK, array('options' => 'foo'));
?>

13 queries. 1,138 seconds. Creative Commons Alexa XHTML CSS Rss Google Site Map Mehmet Mutlu