<?php
if(!defined('IN_DEMOSOSO')) {
  exit('this is wrong page,please back to homepage');
}
function dbgetnum($sql){	  
	     global $db;
         $results = $db->query($sql);
		 $row = $results->fetchArray();
		  if($row<>'') {
		  	return count($row);
		  }
		  else{
		  	return 0;
		  }

}

 

function dbgetrow($sql){
	     global $db;
	     $results = $db->query($sql);
		 $row = $results->fetchArray();
		  if($row<>'') {
		  	return $row;
		  }
		  else{
		  	return 'no';
		  }
	
}

function dbgetall($sql) {
	global $db;
	     $results = $db->query($sql);
		 $row = $results->fetchArray();

		  if($row<>'') {
		  	$results = $db->query($sql);
		   
		  	while($row = $results->fetchArray()){
		           $rowlist[] = $row;
		       }

		  }
		  else{
		  	$rowlist='no';
		  }

		  
         return $rowlist;

	


    
}


function dbiquery($sql) {
     global $db;
	 $db->query($sql);
}

function dmnodepos_sqlitenolang($post,$table){
 foreach ($post as $k=>$v123){
   $v123= (int)$v123;
   $k= (int)$k;
   $ss = "update $table set  pos='$v123' where id='$k'";
   dbiquery($ss);
}
}