All pastes #2085612 Raw Edit

Stuff

public text v1 · immutable
#2085612 ·published 2011-09-30 04:10 UTC
rendered paste body
 // Run the DB query.
echo "SELECT ".$columnlist." FROM " . $tables_read_allowed[$input_tablename]['prefix'].$input_tablename . $whereclause . " " . $orderby;
 $resultset = mysql_unbuffered_query("SELECT ".$columnlist." FROM " . $tables_read_allowed[$input_tablename]['prefix'].$input_tablename . $whereclause . " " . $orderby, $link);
// $resultset = mysql_unbuffered_query('SELECT VERSION()', $link);
$resultset =mysql_unbuffered_query("SELECT CHAR(320)", $link);
// $n2 = microtime(get_as_float);


 // If a resource ID is not returned, something went wrong.
 if ($resultset == null) {echo "Error: could not load data from the database."; return;}

 $outputdata = array();

 // Form the result into the "outputdata" array.
 $currow = 0;
 while ($temp=mysql_fetch_row($resultset)) {
  for ($i=0; $i<$curlen; $i++) {
//echo ord($temp[0])."=".ord($temp[1]);
echo ord($temp[i]);
   $curtype_name = $columnarray_type[$columnarray_keys[$i]];
//echo $curtype_name;
   switch ($curtype_name) {
   case "varchar": $outputdata[$columnarray_keys[$i]][$currow]=$temp[$i]; break;
   default:
    $n = $columntype_id[$curtype_name]+1-strlen($temp[$i]);
//echo "N=".$n;
    if ($n>0) {
     $outputdata[$columnarray_keys[$i]][$currow]=str_repeat(chr(0), $n).$temp[$i];
    } else {
     $outputdata[$columnarray_keys[$i]][$currow]=$temp[$i];
    }
    break;
   }
  }
  for ($i=0; $i<$columns_special_len; $i++) {
   if ($columns_special_loc[$i] !== -1) {
    $outputdata[$columns_special_loc[$i]][$currow] = $username_to_specialname[$i][$temp[$curlen]];
   }
  }
  $currow++; 
 }

 $curlen += $t;