rendered paste bodyfunction _query ($query, $data = array(), $flags = array() ) { if ( count ($data) > 0 ) { $phs = array_map(create_function('$ph', 'return "\'".mysql_real_escape_string($ph)."\'";'), $data); $curpos = 0; $curph = count($phs)-1; for ($i=strlen($query)-1; $i>0; $i--) { if ($query[$i] !== '?') continue; if ($curph < 0 || !isset($phs[$curph])) $query = substr_replace($query, 'NULL', $i, 1); else $query = substr_replace($query, $phs[$curph], $i, 1); $curph--; } unset($curpos, $curph, $phs); } if ( $r = mysql_query($query,$dc) ) { return $r; } else { return null; }}