Autor Zpráva
table
Profil *
Zdravím,
mám problém při zápisu do databáze z CSV.
V CSV jsou statistiky hráčů.
Problém začíná ve chvíli kdy jméno hráče obsahuje ' .
Pak to hodí tuto chybu:
Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 352
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0',' at line 1

kod:
          if (isset($_FILES['fupload']))
    {
  $slozka = "playerstaty/confid=$confid"; // Zde si napi‘te svojí složku, do které se budou soubory ukádat (bez lomítka)
    $cil = $slozka . "/" .$_FILES['fupload']['name']; // Toto je proměnná $cil, která obsahuje adresář, kde se má soubor uploadovat a taky název souboru.
    $nazev_souboru = $_FILES['fupload']['tmp_name']; // Zjistí dočastné umístění souboru
    $copy = move_uploaded_file($nazev_souboru, $cil) // A tady zkopíruje soubor z dočastného umístění do cílového souboru a složky
      or die ("Přenesený soubor nelze zkopírovat"); // A pokud se nepovede, tak vypí‘e tuto hlá‘ku
    chmod ($cil, 0777); // Je‘tě na soubor vyhodíme funkci chmod, která změní jeho práva na maximum, pokud by soubor psal chybu změňte 0644 na 0777
    if($copy == true)
    
    {
    include "db.php";
     $confid=(int)$_GET['conf'];
     $stats="playerstat";
      $confid=(int)$_GET['confid'];
    $confid=intval($_POST['confid']);
     $filename=$cil;

     $handle = fopen("$filename", "r");

     while (($data = fgetcsv($handle, 1000, ',')) !== FALSE)

  {
$rozdeleni_casu = explode(":",$data[3]);
$time= ($rozdeleni_casu[0]*60 + $rozdeleni_casu[1]);
   // i pro multi-byte (napr. UTF-8)
$prevodni_tabulka = Array(
  'ä'=>'a',
  'Ä'=>'A',
  'á'=>'a',
  'Á'=>'A',
  'a'=>'a',
  'A'=>'A',
  'a'=>'a',
  'A'=>'A',
  'â'=>'a',
  'Â'=>'A',
  'č'=>'c',
  'Č'=>'C',
  'ć'=>'c',
  'Ć'=>'C',
  'ď'=>'d',
  'Ď'=>'D',
  'ě'=>'e',
  'Ě'=>'E',
  'é'=>'e',
  'É'=>'E',
  'ë'=>'e',
  'Ë'=>'E',
  'e'=>'e',
  'E'=>'E',
  'e'=>'e',
  'E'=>'E',
  'í'=>'i',
  'Í'=>'I',
  'i'=>'i',
  'I'=>'I',
  'i'=>'i',
  'I'=>'I',
  'î'=>'i',
  'Î'=>'I',
  'ľ'=>'l',
  'Ľ'=>'L',
  'ĺ'=>'l',
  'Ĺ'=>'L',
  'ń'=>'n',
  'Ń'=>'N',
  'ň'=>'n',
  'Ň'=>'N',
  'n'=>'n',
  'N'=>'N',
  'ó'=>'o',
  'Ó'=>'O',
  'ö'=>'o',
  'Ö'=>'O',
  'ô'=>'o',
  'Ô'=>'O',
  'o'=>'o',
  'O'=>'O',
  'o'=>'o',
  'O'=>'O',
  'ő'=>'o',
  'Ő'=>'O',
  'ř'=>'r',
  'Ř'=>'R',
  'ŕ'=>'r',
  'Ŕ'=>'R',
  'š'=>'s',
  'Š'=>'S',
  'ś'=>'s',
  'Ś'=>'S',
  'ť'=>'t',
  'Ť'=>'T',
  'ú'=>'u',
  'Ú'=>'U',
  'ů'=>'u',
  'Ů'=>'U',
  'ü'=>'u',
  'Ü'=>'U',
  'u'=>'u',
  'U'=>'U',
  'u'=>'u',
  'U'=>'U',
  'u'=>'u',
  'U'=>'U',
  'ý'=>'y',
  'Ý'=>'Y',
  'ž'=>'z',
  'Ž'=>'Z',
  'ź'=>'z',
  'Ź'=>'Z'
  
);

$upraveny_text = strtr($data[0], $prevodni_tabulka);    //tady upravuju jméno aby bylo v mnou požadovaném tvaru

    // tu se dívám do databáze jeslti daný hráč už v databázi existuje.
    $exist_hrac = mysql_result(mysql_query("SELECT COUNT(*) FROM $stats  WHERE Team='$data[1]' AND Name = '$upraveny_text' AND confid=$confid"), 0);
//neexistuje -> potom ho vytvoříme pomocí insert
    if($exist_hrac==0){
    if ($upraveny_text != "Player Name" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&&  $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import2="INSERT INTO $stats (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('$confid', '$teamid', '$upraveny_text', '$data[1]', '$data[2]', '$data[4]'+'$data[5]', '$data[4]', '$data[5]',1,'$time','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]','0')";
    mysql_query($import2) or die(mysql_error());
    }
    }
    //existuje -> potom ho aktualizujeme pomocí update
    else {
    if ($upraveny_text != "Player Name" && $data[2] == "Player" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import="UPDATE $stats SET Time=Time+$time,P=P+$data[4]+$data[5], G=G+$data[4], A=A+$data[5], GP=GP+1, PIMS=PIMS+$data[6], plusminus=plusminus+$data[7], PPG=PPG+$data[8], SHG=SHG+$data[9], Shoot=Shoot+$data[10], Hits=Hits+$data[11] WHERE Name='$upraveny_text' AND confid=$confid";
    mysql_query($import) or die(mysql_error());
    }
    else
    {
     if ($upraveny_text != "Player Name" && $data[2] == "Goalie" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-" && $data[10] != "0"&& $data[9] != "-"&& $data[10] != "-")
      {
    $import="UPDATE $stats SET  Time=Time+$time,GP=GP+1, PPG=PPG+$data[8], Shoot=Shoot+$data[10] WHERE Name='$upraveny_text' AND confid=$confid";
    mysql_query($import) or die(mysql_error());
      }
    } 
        }
    
    } 
Luky
Profil
table:
jméno hráče obsahuje ' .
Jméno hráče bych ošetřoval přes addslashes.
juriad
Profil
table:
Pro ošetření vstupu vždy použij funkci určenou přímo pro tu konkrétní databázi, kterou používáš, v tomto případě všechny textové sloupce prožeň skrz mysql_real_escape_string.

Stačí v googlu pohledat: mysql_real_escape_string addslashes a rozdíly by ti měli být zřejmé.
table
Profil *
Já php moc nerozumím, tenhle kod jsem nepsal já:
Zkusil jsem to vyřešit takto:
          if (isset($_FILES['fupload']))
    {
  $slozka = "playerstaty/confid=$confid"; // Zde si napi‘te svojí složku, do které se budou soubory ukádat (bez lomítka)
    $cil = $slozka . "/" .$_FILES['fupload']['name']; // Toto je proměnná $cil, která obsahuje adresář, kde se má soubor uploadovat a taky název souboru.
    $nazev_souboru = $_FILES['fupload']['tmp_name']; // Zjistí dočastné umístění souboru
    $copy = move_uploaded_file($nazev_souboru, $cil) // A tady zkopíruje soubor z dočastného umístění do cílového souboru a složky
      or die ("Přenesený soubor nelze zkopírovat"); // A pokud se nepovede, tak vypí‘e tuto hlá‘ku
    chmod ($cil, 0777); // Je‘tě na soubor vyhodíme funkci chmod, která změní jeho práva na maximum, pokud by soubor psal chybu změňte 0644 na 0777
    if($copy == true)
    
    {
    include "db.php";
     $confid=(int)$_GET['conf'];
     $stats="playerstat";
      $confid=(int)$_GET['confid'];
    $confid=intval($_POST['confid']);
     $filename=$cil;

     $handle = fopen("$filename", "r");

     while (($data = fgetcsv($handle, 1000, ',')) !== FALSE)

  {
$rozdeleni_casu = explode(":",$data[3]);
$time= ($rozdeleni_casu[0]*60 + $rozdeleni_casu[1]);
   // i pro multi-byte (napr. UTF-8)
$prevodni_tabulka = Array(
  "ä"=>"a",
  "Ä"=>"A",
  "á"=>"a",
  "Á"=>"A",
  "a"=>"a",
  "A"=>"A",
  "a"=>"a",
  "A"=>"A",
  "â"=>"a",
  "Â"=>"A",
  "č"=>"c",
  "Č"=>"C",
  "ć"=>"c",
  "Ć"=>"C",
  "ď"=>"d",
  "Ď"=>"D",
  "ě"=>"e",
  "Ě"=>"E",
  "é"=>"e",
  "É"=>"E",
  "ë"=>"e",
  "Ë"=>"E",
  "e"=>"e",
  "E"=>"E",
  "e"=>"e",
  "E"=>"E",
  "í"=>"i",
  "Í"=>"I",
  "i"=>"i",
  "I"=>"I",
  "i"=>"i",
  "I"=>"I",
  "î"=>"i",
  "Î"=>"I",
  "ľ"=>"l",
  "Ľ"=>"L",
  "ĺ"=>"l",
  "Ĺ"=>"L",
  "ń"=>"n",
  "Ń"=>"N",
  "ň"=>"n",
  "Ň"=>"N",
  "n"=>"n",
  "N"=>"N",
  "ó"=>"o",
  "Ó"=>"O",
  "ö"=>"o",
  "Ö"=>"O",
  "ô"=>"o",
  "Ô"=>"O",
  "o"=>"o",
  "O"=>"O",
  "o"=>"o",
  "O"=>"O",
  "ő"=>"o",
  "Ő"=>"O",
  "ř"=>"r",
  "Ř"=>"R",
  "ŕ"=>"r",
  "Ŕ"=>"R",
  "š"=>"s",
  "Š"=>"S",
  "ś"=>"s",
  "Ś"=>"S",
  "ť"=>"t",
  "Ť"=>"T",
  "ú"=>"u",
  "Ú"=>"U",
  "ů"=>"u",
  "Ů"=>"U",
  "ü"=>"u",
  "Ü"=>"U",
  "u"=>"u",
  "U"=>"U",
  "u"=>"u",
  "U"=>"U",
  "u"=>"u",
  "U"=>"U",
  "ý"=>"y",
  "Ý"=>"Y",
  "ž"=>"z",
  "Ž"=>"Z",
  "ź"=>"z",
  "'"=>" ",
  "Ź"=>"Z"
  
);

$upraveny_text = strtr($data[0], $prevodni_tabulka);    //tady upravuju jméno aby bylo v mnou požadovaném tvaru

    // tu se dívám do databáze jeslti daný hráč už v databázi existuje.
    $exist_hrac = mysql_result(mysql_query("SELECT COUNT(*) FROM $stats  WHERE Team='$data[1]' AND Name = '$upraveny_text' AND confid=$confid"), 0);
//neexistuje -> potom ho vytvoříme pomocí insert
    if($exist_hrac==0){
    if ($upraveny_text != "Player Name" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&&  $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import2="INSERT INTO $stats (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('$confid', '$teamid', '$upraveny_text', '$data[1]', '$data[2]', '$data[4]'+'$data[5]', '$data[4]', '$data[5]',1,'$time','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]','0')";
    mysql_query($import2) or die(mysql_error());
    }
    }
    //existuje -> potom ho aktualizujeme pomocí update
    else {
    if ($upraveny_text != "Player Name" && $data[2] == "Player" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import="UPDATE $stats SET Time=Time+$time,P=P+$data[4]+$data[5], G=G+$data[4], A=A+$data[5], GP=GP+1, PIMS=PIMS+$data[6], plusminus=plusminus+$data[7], PPG=PPG+$data[8], SHG=SHG+$data[9], Shoot=Shoot+$data[10], Hits=Hits+$data[11] WHERE Name='$upraveny_text' AND confid=$confid";
    mysql_query($import) or die(mysql_error());
    }
    else
    {
     if ($upraveny_text != "Player Name" && $data[2] == "Goalie" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-" && $data[10] != "0"&& $data[9] != "-"&& $data[10] != "-")
      {
    $import="UPDATE $stats SET  Time=Time+$time,GP=GP+1, PPG=PPG+$data[8], Shoot=Shoot+$data[10] WHERE Name='$upraveny_text' AND confid=$confid";
    mysql_query($import) or die(mysql_error());
      }
    } 
        }
    
    } 
Předělal jsem toto:
"ä"=>"a",
"Ä"=>"A",
"á"=>"a",
"Á"=>"A",
"a"=>"a",
"A"=>"A",
"a"=>"a",
"A"=>"A",
"â"=>"a",
"Â"=>"A",
"č"=>"c",
"Č"=>"C",
"ć"=>"c",
"Ć"=>"C",
"ď"=>"d",
"Ď"=>"D",
"ě"=>"e",
"Ě"=>"E",
"é"=>"e",
"É"=>"E",
"ë"=>"e",
"Ë"=>"E",
"e"=>"e",
"E"=>"E",
"e"=>"e",
"E"=>"E",
"í"=>"i",
"Í"=>"I",
"i"=>"i",
"I"=>"I",
"i"=>"i",
"I"=>"I",
"î"=>"i",
"Î"=>"I",
"ľ"=>"l",
"Ľ"=>"L",
"ĺ"=>"l",
"Ĺ"=>"L",
"ń"=>"n",
"Ń"=>"N",
"ň"=>"n",
"Ň"=>"N",
"n"=>"n",
"N"=>"N",
"ó"=>"o",
"Ó"=>"O",
"ö"=>"o",
"Ö"=>"O",
"ô"=>"o",
"Ô"=>"O",
"o"=>"o",
"O"=>"O",
"o"=>"o",
"O"=>"O",
"ő"=>"o",
"Ő"=>"O",
"ř"=>"r",
"Ř"=>"R",
"ŕ"=>"r",
"Ŕ"=>"R",
"š"=>"s",
"Š"=>"S",
"ś"=>"s",
"Ś"=>"S",
"ť"=>"t",
"Ť"=>"T",
"ú"=>"u",
"Ú"=>"U",
"ů"=>"u",
"Ů"=>"U",
"ü"=>"u",
"Ü"=>"U",
"u"=>"u",
"U"=>"U",
"u"=>"u",
"U"=>"U",
"u"=>"u",
"U"=>"U",
"ý"=>"y",
"Ý"=>"Y",
"ž"=>"z",
"Ž"=>"Z",
"ź"=>"z",
"'"=>" ",
"Ź"=>"Z"
Přidal jsem tam :"'"=>" ",
Teď už to zapíše všechny hráče ale hází to stejně chybu : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'Latendresse Guillaume, Phillips Chris', '2013-05-19-12-05-34' )' at line 1
table
Profil *
stejně nechápu to řešení.
table
Profil *
celý odpoledne se s tím trapim, ale nato jak to vyresit jsem nepřišel. Neupravil by mi někdo ten kod prosím
Luky
Profil
Zkus ten $upraveny_text ošetřit tím addslashes.
$upraveny_text = addslashes($upraveny_text) 

table:
Přidal jsem tam :"'"=>" "
To měla právě ošetřit ta zmiňovaná funkce. mysql_real_escape_string jsem nezmiňoval z toho důvodu, že potřebuješ ošetřit anglické jméno (O'reilly).

Chyba tedy bude zřejmě v něčem jiném...
table
Profil *
Pokud použiji toto:
$upraveny_text = addslashes($data[0]);
Tak stejná chyba
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'Latendresse Guillaume, Phillips Chris', '2013-05-19-12-05-34' )' at line 1
juriad
Profil
Nejspíš je chyba v tom, že formát datumu: 2013-05-19-12-05-34 není platný v mysql, správně má být 2013-05-19 12:05:34.
Ale vůbec mi to nesedí na insert, který se provádí. Jsi si jistý, že chyba je v uvedeném kusu kódu? Neprovádíš INSERT ještě někde jinde? PHP hlásí u chyby, na jakém řádku nastala.
table
Profil *
Takže dal jsem ten kod zpět do stavu jako byl před tím:
          if (isset($_FILES['fupload']))
    {
  $slozka = "playerstaty/confid=$confid"; // Zde si napi‘te svojí složku, do které se budou soubory ukádat (bez lomítka)
    $cil = $slozka . "/" .$_FILES['fupload']['name']; // Toto je proměnná $cil, která obsahuje adresář, kde se má soubor uploadovat a taky název souboru.
    $nazev_souboru = $_FILES['fupload']['tmp_name']; // Zjistí dočastné umístění souboru
    $copy = move_uploaded_file($nazev_souboru, $cil) // A tady zkopíruje soubor z dočastného umístění do cílového souboru a složky
      or die ("Přenesený soubor nelze zkopírovat"); // A pokud se nepovede, tak vypí‘e tuto hlá‘ku
    chmod ($cil, 0777); // Je‘tě na soubor vyhodíme funkci chmod, která změní jeho práva na maximum, pokud by soubor psal chybu změňte 0644 na 0777
    if($copy == true)
    
    {
    include "db.php";
     $confid=(int)$_GET['conf'];
     $stats="playerstat";
      $confid=(int)$_GET['confid'];
    $confid=intval($_POST['confid']);
     $filename=$cil;

     $handle = fopen($filename, "r");

     while (($data = fgetcsv($handle, 1000, ',')) !== FALSE)

  {
$rozdeleni_casu = explode(":",$data[3]);
$time= ($rozdeleni_casu[0]*60 + $rozdeleni_casu[1]);
   // i pro multi-byte (napr. UTF-8)
$prevodni_tabulka = Array(
  'ä'=>'a',
  'Ä'=>'A',
  'á'=>'a',
  'Á'=>'A',
  'a'=>'a',
  'A'=>'A',
  'a'=>'a',
  'A'=>'A',
  'â'=>'a',
  'Â'=>'A',
  'č'=>'c',
  'Č'=>'C',
  'ć'=>'c',
  'Ć'=>'C',
  'ď'=>'d',
  'Ď'=>'D',
  'ě'=>'e',
  'Ě'=>'E',
  'é'=>'e',
  'É'=>'E',
  'ë'=>'e',
  'Ë'=>'E',
  'e'=>'e',
  'E'=>'E',
  'e'=>'e',
  'E'=>'E',
  'í'=>'i',
  'Í'=>'I',
  'i'=>'i',
  'I'=>'I',
  'i'=>'i',
  'I'=>'I',
  'î'=>'i',
  'Î'=>'I',
  'ľ'=>'l',
  'Ľ'=>'L',
  'ĺ'=>'l',
  'Ĺ'=>'L',
  'ń'=>'n',
  'Ń'=>'N',
  'ň'=>'n',
  'Ň'=>'N',
  'n'=>'n',
  'N'=>'N',
  'ó'=>'o',
  'Ó'=>'O',
  'ö'=>'o',
  'Ö'=>'O',
  'ô'=>'o',
  'Ô'=>'O',
  'o'=>'o',
  'O'=>'O',
  'o'=>'o',
  'O'=>'O',
  'ő'=>'o',
  'Ő'=>'O',
  'ř'=>'r',
  'Ř'=>'R',
  'ŕ'=>'r',
  'Ŕ'=>'R',
  'š'=>'s',
  'Š'=>'S',
  'ś'=>'s',
  'Ś'=>'S',
  'ť'=>'t',
  'Ť'=>'T',
  'ú'=>'u',
  'Ú'=>'U',
  'ů'=>'u',
  'Ů'=>'U',
  'ü'=>'u',
  'Ü'=>'U',
  'u'=>'u',
  'U'=>'U',
  'u'=>'u',
  'U'=>'U',
  'u'=>'u',
  'U'=>'U',
  'ý'=>'y',
  'Ý'=>'Y',
  'ž'=>'z',
  'Ž'=>'Z',
  'ź'=>'z',
  'Ź'=>'Z'
);

$upraveny_text = strtr($data[0], $prevodni_tabulka);

    $exist_hrac = mysql_result(mysql_query("SELECT COUNT(*) FROM $stats WHERE Name = '$upraveny_text' AND confid='$confid'"), 0);
    
    if($exist_hrac==0){
    if ($upraveny_text != "Player Name" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&&  $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import2="INSERT INTO $stats (Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('$upraveny_text', '$data[1]', '$data[2]', '$data[4]'+'$data[5]', '$data[4]', '$data[5]',1,'$time','$data[6]','$data[7]','$data[8]','$data[9]','$data[10]','$data[11]','0')";
    mysql_query($import2) or die(mysql_error());
    }
    }

    else {
    if ($upraveny_text != "Player Name" && $data[2] == "Player" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-"&& $data[9] != "-"&& $data[10] != "-")
    {
    $import="UPDATE $stats SET Time=Time+$time,P=P+$data[4]+$data[5], G=G+$data[4], A=A+$data[5], GP=GP+1, PIMS=PIMS+$data[6], plusminus=plusminus+$data[7], PPG=PPG+$data[8], SHG=SHG+$data[9], Shoot=Shoot+$data[10], Hits=Hits+$data[11] WHERE Name='$upraveny_text'";
    mysql_query($import) or die(mysql_error());
    }
    else
    {
     if ($upraveny_text != "Player Name" && $data[2] == "Goalie" && $data[1] != "-"&& $data[2] != "-"&& $data[3] != "-"&& $data[5] != "-"&& $data[6] != "-"&& $data[8] != "-" && $data[10] != "0"&& $data[9] != "-"&& $data[10] != "-")
      {
    $import="UPDATE $stats SET  Time=Time+$time,GP=GP+1, PPG=PPG+$data[8], Shoot=Shoot+$data[10] WHERE Name='$upraveny_text'";
    mysql_query($import) or die(mysql_error());
      }
    }
        }
    
    }
Pokud ve jméně existuje ' hodí to tyto chyby:

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 354
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0',' at line 1
Na řádku 354 je:
$exist_hrac = mysql_result(mysql_query("SELECT COUNT(*) FROM $stats WHERE Name = '$upraveny_text' AND confid='$confid'"), 0);
Pokud ve jméně ' není tak se zapíše výsledek v pořádku.
juriad
Profil
Veškeré texty, které ukládáš do databáze mysql ošetři funkcí mysql_real_escape_string. Na addslashes zapomeň. Toto vyřeší všechny ty apostrofy.

Zároveň si vypisuj všechny dotazy, které do databáze pošleš - napřed sestav řetězec, potom ho vypiš a potom ho v mysql vykonej. Tím zjistíš celý dotaz, který selhává. Asi takto:
$select = "SELECT COUNT(*) FROM $stats WHERE Name = '" . mysql_real_escape_string($upraveny_text) . "' AND confid='" . mysql_real_escape_string($confid) ."'";
echo $select . "\n<br>\n";
mysql_query($select);

Pokud bude nadále něco padat, dej nám celý dotaz a schéma tabulky (jaké má sloupce a jakého typu jsou).
table
Profil *
Schéme tabulky zde: http://2imgs.com/2i/i/519a36f3/2b47e256fa3da2cdc831cec2f52f5e0b/a7587a5083.f.png

Celý kod je zde:
http://pastebin.com/PAahJKFw
Hráče to začíná zpracovávat od řádku 239 do řádku 381.

Nyní to háže tyto chyby:

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355

Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/michales.eu/michales.eu/pridat_statistiku.php on line 355
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0',' at line 1


Pardon správné schéma je zde: http://2imgs.com/2i/i/519a3be3/af6daac341efe4633ca02f177c3fb96a/7ce3c1eb38.f.png
juriad
Profil
A proč to nenapíšeš, tak jak jsem to sem uvedl já? Chybí ti tam apostrof uvnitř řetězce, ten poslední kousek má být "'".
Napřed si slož celý dotaz, pak ho vypiš a pak ho předej funkci mysql_query. A to neplatí jen pro select, ale pro všechny.
Jakmile to všechno bude fungovat, tak výpisy zrušíš.

Žádné schéma nevidím, je tam jen obrázek o velikosti 1x1 pixel. Ale snad nebude nutné, pokud uděláš, co píšu.
table
Profil *
Opraveno a nyní to vypisuje:
SELECT COUNT(*) FROM playerstat WHERE Name = 'Player Name' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gagne Simon' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Timonen Kimmo' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Briere Daniel' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Couturier Sean' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Giroux Claude' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Hartnell Scott' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Read Matt' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Brayden' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Simmonds Wayne' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Talbot Maxime' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Manning Brandon' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Luke' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gervais Bruno' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Fedotenko Ruslan' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Voracek Jakub' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Foster Kurtis' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Huskins Kent' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Knuble Mike' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Bryzgalov Ilja' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Mason Steve' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Cowen Jared' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gonchar Sergei' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Phillips Chris' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'O\'Brien Jim' AND confid='12'
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0',' at line 1
juriad
Profil
Skvěle, a teď stejně předělej všechny zbývající dotazy (jak inserty, tak updaty).
table
Profil *
SELECT COUNT(*) FROM playerstat WHERE Name = 'Player Name' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gagne Simon' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gagne Simon', 'PHI', 'Player', '0'+'0', '0', '0',1,'927','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Timonen Kimmo' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Timonen Kimmo', 'PHI', 'Player', '0'+'1', '0', '1',1,'1165','0','1','0','0','4','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Briere Daniel' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Briere Daniel', 'PHI', 'Player', '0'+'2', '0', '2',1,'1114','0','1','0','0','6','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Couturier Sean' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Couturier Sean', 'PHI', 'Player', '0'+'1', '0', '1',1,'593','0','-1','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Giroux Claude' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Giroux Claude', 'PHI', 'Player', '0'+'1', '0', '1',1,'918','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Hartnell Scott' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Hartnell Scott', 'PHI', 'Player', '0'+'0', '0', '0',1,'1015','2','0','0','0','2','3','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Read Matt' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Read Matt', 'PHI', 'Player', '0'+'0', '0', '0',1,'667','0','0','0','0','3','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Brayden' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Schenn Brayden', 'PHI', 'Player', '0'+'0', '0', '0',1,'1147','0','-1','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Simmonds Wayne' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Simmonds Wayne', 'PHI', 'Player', '0'+'0', '0', '0',1,'953','0','0','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Talbot Maxime' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Talbot Maxime', 'PHI', 'Player', '0'+'0', '0', '0',1,'569','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Manning Brandon' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Manning Brandon', 'PHI', 'Player', '0'+'0', '0', '0',1,'1634','0','-1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Luke' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Schenn Luke', 'PHI', 'Player', '0'+'1', '0', '1',1,'1176','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gervais Bruno' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gervais Bruno', 'PHI', 'Player', '0'+'0', '0', '0',1,'1043','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Fedotenko Ruslan' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Fedotenko Ruslan', 'PHI', 'Player', '1'+'0', '1', '0',1,'613','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Voracek Jakub' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Voracek Jakub', 'PHI', 'Player', '0'+'0', '0', '0',1,'849','0','0','0','0','6','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Foster Kurtis' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Foster Kurtis', 'PHI', 'Player', '0'+'0', '0', '0',1,'1460','0','-1','0','0','0','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Huskins Kent' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Huskins Kent', 'PHI', 'Player', '0'+'0', '0', '0',1,'695','0','-1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Knuble Mike' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Knuble Mike', 'PHI', 'Player', '3'+'0', '3', '0',1,'1112','2','0','2','0','5','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Bryzgalov Ilja' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Bryzgalov Ilja', 'PHI', 'Goalie', '-'+'0', '-', '0',1,'3509','0','-','3','0','34','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Mason Steve' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Mason Steve', 'PHI', 'Goalie', '-'+'0', '-', '0',1,'0','0','-','0','0','0','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Cowen Jared' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Cowen Jared', 'OTT', 'Player', '0'+'0', '0', '0',1,'972','0','0','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gonchar Sergei' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gonchar Sergei', 'OTT', 'Player', '0'+'0', '0', '0',1,'1681','0','-1','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Phillips Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Phillips Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'935','2','1','0','0','0','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'O\'Brien Jim' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'O\'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Condra Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Condra Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'726','0','0','0','0','2','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Greening Colin' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Greening Colin', 'OTT', 'Player', '0'+'0', '0', '0',1,'685','2','1','0','0','3','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Neil Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Neil Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'763','0','2','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Regin Peter' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Regin Peter', 'OTT', 'Player', '1'+'0', '1', '0',1,'721','2','0','0','0','4','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Smith Zack' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Smith Zack', 'OTT', 'Player', '0'+'0', '0', '0',1,'964','0','0','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Turris Kyle' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Turris Kyle', 'OTT', 'Player', '0'+'0', '0', '0',1,'1170','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Alfredsson Daniel' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Alfredsson Daniel', 'OTT', 'Player', '0'+'0', '0', '0',1,'1150','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Michalek Milan' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Michalek Milan', 'OTT', 'Player', '0'+'0', '0', '0',1,'730','0','0','0','0','3','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Wiercioch Patrick' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Wiercioch Patrick', 'OTT', 'Player', '0'+'1', '0', '1',1,'1122','0','0','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Karlsson Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Karlsson Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'794','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Kassian Matt' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Kassian Matt', 'OTT', 'Player', '0'+'1', '0', '1',1,'200','0','1','0','0','2','1','0')
SE


To je insert, protože update probíhá jen když už hráč existuje


pokračování, nevešlo se to sem celé:
SELECT COUNT(*) FROM playerstat WHERE Name = 'Latendresse Guillaume' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Latendresse Guillaume', 'OTT', 'Player', '0'+'1', '0', '1',1,'907','2','0','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Benoit Andre' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Benoit Andre', 'OTT', 'Player', '0'+'1', '0', '1',1,'1696','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Silfverberg Jakob' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Silfverberg Jakob', 'OTT', 'Player', '1'+'0', '1', '0',1,'330','0','1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Anderson Craig' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Anderson Craig', 'OTT', 'Goalie', '-'+'0', '-', '0',1,'3597','0','-','4','0','33','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Lehner Robin' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Lehner Robin', 'OTT', 'Goalie', '-'+'0', '-', '0',1,'0','0','-','0','0','0','-','0')
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'Latendresse Guillaume, Phillips Chris', '2013-05-20-16-23-07' )' at line 1
juriad
Profil
ještě provádíš insert na řádce 420, na ten úplně zapomínáš :)
table
Profil *
Na řádku 420 se už zpracovává jiné CSV. To už nejsou hráči ale statistika ze hry.
Nicméně udělal jsem to a:
SELECT COUNT(*) FROM playerstat WHERE Name = 'Player Name' AND confid='12'
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gagne Simon' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gagne Simon', 'PHI', 'Player', '0'+'0', '0', '0',1,'927','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Timonen Kimmo' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Timonen Kimmo', 'PHI', 'Player', '0'+'1', '0', '1',1,'1165','0','1','0','0','4','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Briere Daniel' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Briere Daniel', 'PHI', 'Player', '0'+'2', '0', '2',1,'1114','0','1','0','0','6','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Couturier Sean' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Couturier Sean', 'PHI', 'Player', '0'+'1', '0', '1',1,'593','0','-1','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Giroux Claude' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Giroux Claude', 'PHI', 'Player', '0'+'1', '0', '1',1,'918','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Hartnell Scott' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Hartnell Scott', 'PHI', 'Player', '0'+'0', '0', '0',1,'1015','2','0','0','0','2','3','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Read Matt' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Read Matt', 'PHI', 'Player', '0'+'0', '0', '0',1,'667','0','0','0','0','3','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Brayden' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Schenn Brayden', 'PHI', 'Player', '0'+'0', '0', '0',1,'1147','0','-1','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Simmonds Wayne' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Simmonds Wayne', 'PHI', 'Player', '0'+'0', '0', '0',1,'953','0','0','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Talbot Maxime' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Talbot Maxime', 'PHI', 'Player', '0'+'0', '0', '0',1,'569','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Manning Brandon' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Manning Brandon', 'PHI', 'Player', '0'+'0', '0', '0',1,'1634','0','-1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Schenn Luke' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Schenn Luke', 'PHI', 'Player', '0'+'1', '0', '1',1,'1176','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gervais Bruno' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gervais Bruno', 'PHI', 'Player', '0'+'0', '0', '0',1,'1043','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Fedotenko Ruslan' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Fedotenko Ruslan', 'PHI', 'Player', '1'+'0', '1', '0',1,'613','0','-1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Voracek Jakub' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Voracek Jakub', 'PHI', 'Player', '0'+'0', '0', '0',1,'849','0','0','0','0','6','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Foster Kurtis' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Foster Kurtis', 'PHI', 'Player', '0'+'0', '0', '0',1,'1460','0','-1','0','0','0','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Huskins Kent' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Huskins Kent', 'PHI', 'Player', '0'+'0', '0', '0',1,'695','0','-1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Knuble Mike' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Knuble Mike', 'PHI', 'Player', '3'+'0', '3', '0',1,'1112','2','0','2','0','5','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Bryzgalov Ilja' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Bryzgalov Ilja', 'PHI', 'Goalie', '-'+'0', '-', '0',1,'3509','0','-','3','0','34','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Mason Steve' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Mason Steve', 'PHI', 'Goalie', '-'+'0', '-', '0',1,'0','0','-','0','0','0','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Cowen Jared' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Cowen Jared', 'OTT', 'Player', '0'+'0', '0', '0',1,'972','0','0','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Gonchar Sergei' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gonchar Sergei', 'OTT', 'Player', '0'+'0', '0', '0',1,'1681','0','-1','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Phillips Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Phillips Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'935','2','1','0','0','0','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'O\'Brien Jim' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'O\'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Condra Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Condra Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'726','0','0','0','0','2','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Greening Colin' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Greening Colin', 'OTT', 'Player', '0'+'0', '0', '0',1,'685','2','1','0','0','3','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Neil Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Neil Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'763','0','2','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Regin Peter' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Regin Peter', 'OTT', 'Player', '1'+'0', '1', '0',1,'721','2','0','0','0','4','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Smith Zack' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Smith Zack', 'OTT', 'Player', '0'+'0', '0', '0',1,'964','0','0','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Turris Kyle' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Turris Kyle', 'OTT', 'Player', '0'+'0', '0', '0',1,'1170','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Alfredsson Daniel' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Alfredsson Daniel', 'OTT', 'Player', '0'+'0', '0', '0',1,'1150','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Michalek Milan' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Michalek Milan', 'OTT', 'Player', '0'+'0', '0', '0',1,'730','0','0','0','0','3','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Wiercioch Patrick' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Wiercioch Patrick', 'OTT', 'Player', '0'+'1', '0', '1',1,'1122','0','0','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Karlsson Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Karlsson Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'794','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Kassian Matt' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID)


SELECT COUNT(*) FROM playerstat WHERE Name = 'Gonchar Sergei' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Gonchar Sergei', 'OTT', 'Player', '0'+'0', '0', '0',1,'1681','0','-1','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Phillips Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Phillips Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'935','2','1','0','0','0','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'O\'Brien Jim' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'O\'Brien Jim', 'OTT', 'Player', '1'+'0', '1', '0',1,'1338','0','0','0','0','4','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Condra Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Condra Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'726','0','0','0','0','2','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Greening Colin' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Greening Colin', 'OTT', 'Player', '0'+'0', '0', '0',1,'685','2','1','0','0','3','2','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Neil Chris' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Neil Chris', 'OTT', 'Player', '0'+'1', '0', '1',1,'763','0','2','0','0','1','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Regin Peter' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Regin Peter', 'OTT', 'Player', '1'+'0', '1', '0',1,'721','2','0','0','0','4','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Smith Zack' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Smith Zack', 'OTT', 'Player', '0'+'0', '0', '0',1,'964','0','0','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Turris Kyle' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Turris Kyle', 'OTT', 'Player', '0'+'0', '0', '0',1,'1170','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Alfredsson Daniel' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Alfredsson Daniel', 'OTT', 'Player', '0'+'0', '0', '0',1,'1150','0','-1','0','0','5','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Michalek Milan' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Michalek Milan', 'OTT', 'Player', '0'+'0', '0', '0',1,'730','0','0','0','0','3','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Wiercioch Patrick' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Wiercioch Patrick', 'OTT', 'Player', '0'+'1', '0', '1',1,'1122','0','0','0','0','0','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Karlsson Erik' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Karlsson Erik', 'OTT', 'Player', '0'+'0', '0', '0',1,'794','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Kassian Matt' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Kassian Matt', 'OTT', 'Player', '0'+'1', '0', '1',1,'200','0','1','0','0','2','1','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Latendresse Guillaume' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Latendresse Guillaume', 'OTT', 'Player', '0'+'1', '0', '1',1,'907','2','0','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Benoit Andre' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Benoit Andre', 'OTT', 'Player', '0'+'1', '0', '1',1,'1696','0','1','0','0','0','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Silfverberg Jakob' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Silfverberg Jakob', 'OTT', 'Player', '1'+'0', '1', '0',1,'330','0','1','0','0','1','0','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Anderson Craig' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Anderson Craig', 'OTT', 'Goalie', '-'+'0', '-', '0',1,'3597','0','-','4','0','33','-','0')
SELECT COUNT(*) FROM playerstat WHERE Name = 'Lehner Robin' AND confid='12'
INSERT INTO playerstat (confid,teamid,Name,Team,Pos,P,G,A,GP,Time,PIMS,plusminus,PPG,SHG,Shoot,Hits,ID) VALUES ('12', '', 'Lehner Robin', 'OTT', 'Goalie', '-'+'0', '-', '0',1,'0','0','-','0','0','0','-','0')
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','1', '02:19', 'PEN', 'OTT', 'Phillips Chris', 'Interference (Minor)', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','1', '06:23', 'PPG (1:0)', 'PHI', 'Knuble Mike', 'Briere Daniel, Schenn Luke', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','1', '11:49', 'PEN', 'OTT', 'Greening Colin', 'Interference (Minor)', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','2', '06:24', 'GOAL (1:1)', 'OTT', 'Regin Peter', 'Neil Chris, Benoit André', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','2', '14:02', 'GOAL (1:2)', 'OTT', 'Silfverberg Jakob', 'Kassian Matt, Wiercioch Patrick', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '00:41', 'PEN', 'PHI', 'Hartnell Scott', 'Cross checking (Minor)', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '02:46', 'PEN', 'OTT', 'Latendresse Guillaume', 'Interference (Minor)', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '05:46', 'PEN', 'OTT', 'Regin Peter', 'Interference (Minor)', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '07:22', 'PPG (2:2)', 'PHI', 'Knuble Mike', 'Giroux Claude, Timonen Kimmo', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '11:40', 'GOAL (3:2)', 'PHI', 'Knuble Mike', 'Briere Daniel', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '13:14', 'GOAL (4:2)', 'PHI', 'Fedotenko Ruslan', 'Couturier Sean', '2013-05-20-16-38-30' )
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'Latendresse Guillaume, Phillips Chris', '2013-


INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '07:22', 'PPG (2:2)', 'PHI', 'Knuble Mike', 'Giroux Claude, Timonen Kimmo', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '11:40', 'GOAL (3:2)', 'PHI', 'Knuble Mike', 'Briere Daniel', '2013-05-20-16-38-30' )
INSERT INTO gamestaty (confid,teamid,Period,Time,Goal,Team,Name,Note,datum) VALUES ('12', '','3', '13:14', 'GOAL (4:2)', 'PHI', 'Fedotenko Ruslan', 'Couturier Sean', '2013-05-20-16-38-30' )
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Brien Jim', 'Latendresse Guillaume, Phillips Chris', '2013-05-20
juriad
Profil
Musí to být až tam, protože jinde nevkládáš 2-3 jména (do dvou sloupečků za sebe). Ošetřuješ pomocí mysql_real_escape_string všechny textové sloupce? Včetně $data[4], $data[5]?
Playerstat ti už evidentně funguje.

Nevkládej sem kilometry výpisu, stačí posledních pár řádek.
table
Profil *
Tak ti mockrát děkuji, už je vše vyřeené. Bylo to opravdu v poslední insertu.
Moc díky.
juriad
Profil
Poučení: vždy všechno escapuj a nevěř, že náhodnou nestane problém.
Nemáš zač.

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: