zintis8789 Posted November 17, 2009 Report Share Posted November 17, 2009 (edited) Es meiģinu ievietot .csv failu tur ir iekšā vārds: D'Agostini .Vins to nesaprot un man uzmet erroru: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\csv\index.php on line 24 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 'Agostini Matt','MTL','Player','1','13:39','0','0','0','-2','0','0','0','3','0')' at line 1 Bet parejos vārdus vinš iemet datubāzē. Edited November 17, 2009 by zintis8789 Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted November 17, 2009 Report Share Posted November 17, 2009 Pirms mešanas datu bāzē vajadzētu izdarīt tādu mazu lietiņu kā - mysql_real_escape_string() Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 Tagad man met šādu erroru: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\csv\index.php on line 24 Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 18, 2009 Report Share Posted November 18, 2009 papildini mysql_query(...); ar: mysql_query(...) or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 Es pieliku klāt: mysql_real_escape_string() Bet tikuntā man rāda: 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 'not,team,name,note) values('1','Period','Time','Goal/Penalty','Team','Player Nam' at line 1 Quote Link to comment Share on other sites More sharing options...
Val Posted November 18, 2009 Report Share Posted November 18, 2009 ieliec te pilnu sql insertu. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 while (($data2 = fgetcsv($handle2, 1000, ",")) != FALSE) { $ccm12 = mysql_real_escape_string($data2[2]); $ccm1 = mysql_real_escape_string($data2[4]); $ccm121 = mysql_real_escape_string($data2[5]); $time = mysql_real_escape_string($data2[1]); $kpp = mysql_real_escape_string($data2[3]); $per = mysql_real_escape_string($data2[0]); $import2="INSERT into teamstat(id,per,time,not,team,name,note) values('$nr1','$per','$time','$ccm12','$kpp','$ccm1','$ccm121')"; mysql_query($import2) or die(mysql_error()); mysql_query("DELETE FROM teamstat WHERE team='Team'"); } Quote Link to comment Share on other sites More sharing options...
Val Posted November 18, 2009 Report Share Posted November 18, 2009 biju domājis echo $import2; id ņem ārā, un labāk pieliec tai kolonnai autoincrement un netaisi problēmas, kur tās nav. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 (edited) Izņemu arā Id bet tikuntā tas pats errors! Edited November 18, 2009 by zintis8789 Quote Link to comment Share on other sites More sharing options...
Val Posted November 18, 2009 Report Share Posted November 18, 2009 ar $nr tas pats. un izlasi vēlreiz manu iepriekšējo postu. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 Daru visu ko tu saki bet tā pat radas tas errors :( Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 18, 2009 Author Report Share Posted November 18, 2009 Mazus uzlabojumus veicu un viss aizgāja .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.