Добавяне резултати в бд ( не става )

uphero

Registered
с тоя код трябва да се добавят резултатите от едната таблица в другата таблица но не става


Код:
		 <?php
$m_time = explode(" ",microtime()); 
$m_time = $m_time[0] + $m_time[1]; 
$starttime = $m_time;

DEFINE('human',true);
include('includes/functions.php');
include('includes/config.php');
include('includes/mysql.class.php');
$db=new Mysql($dbhost,$dbuser,$dbpasswd,$dbname);
?>						

<?php
$s = mysql_query("SELECT * FROM servers");
while($r = mysql_fetch_array($s))
{






	
		$sinfo = query($r[ip], $r[port], 'info');

    if($sinfo){$status = 'green';

  $ime = $r[ime];

$game = $r[game];
if($game==cs)
{
$game='cs1.6';
}
  $karta = isset($sinfo[mapname]) ? $sinfo[mapname] : 'N/A';

$sinfo[players] = isset($sinfo[players]) ? $sinfo[players] : 0;

$sinfo[maxplayers] = isset($sinfo[maxplayers]) ? $sinfo[maxplayers] : 0;

  $players = $sinfo[players].'/'.$sinfo[maxplayers];
$play=$sinfo[players];
$maxplay=$sinfo[maxplayers];
$r[ip]=gethostbyname($r[ip]);

		
		
		$sida= $r[sid];
		$imeto=$r[ime];
		$ip= $r[ip];
		$port=$r[port];
		$mail=$r[mail];
		$dop=$r[dop];
		$views=$r[views];
		$hash=$r[hash];
			$url=$r[url];
		$cida=$r[cid];
		
		

mysql_query('INSERT INTO server (mail,dop,views,hash,url,game,sid,ime,ip,port,cid,play,maxplay,karta,od,vip)
	  VALUES ("'.$mail.','.$dop.','.$views.','.$hash.','.$url.','.$game.', '.$sida.', '.$imeto.', '.$ip.', '.$port.','.$cida.','.$play.','.$maxplay.','.$karta.'","1","0")');
}
	} 

	?>
SQl

Код:
CREATE TABLE IF NOT EXISTS `server` (
  `ime` char(60) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci NOT NULL,
  `ip` varchar(255) NOT NULL,
  `port` varchar(5) NOT NULL,
  `cid` int(11) NOT NULL,
  `dop` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `mail` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `hash` varchar(32) NOT NULL,
  `od` int(1) NOT NULL,
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  `views` int(20) NOT NULL DEFAULT '0',
  `vip` text NOT NULL,
  `game` text NOT NULL,
  `karta` varchar(50) NOT NULL,
  `play` varchar(50) NOT NULL,
  `maxplay` varchar(50) NOT NULL,
  PRIMARY KEY (`sid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=71 ;
 

Горе