Jump to content

Recommended Posts

Really struggling with this one.  This is a huge upload script that pulls data from a text file that is spit out from a game.  I am inserting into multiple tables with one text file.  The first insert works perfectly, the second gives me this error: Error in result: 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 ':51.515, '180.879mph', 'Clear', '76^', 'NW', '6mpÈ', '1.747sec', 2, 17, 2010)' at line 2

 

Here is the actual php file:

<?
include("../include/session.php");

/**
* User not an administrator, redirect to main page
* automatically.
*/
if(!$session->isAdmin()){
   header("Location: ../main.php");
}
else{
/**
* Administrator is viewing page, so display all
* forms.
*/
?>
<?

// tab delimited file 
$file = "../stn/standings.stn"; 

// open file 
$handle = fopen($file, "rb");
$contents = fread($handle, filesize($file));

// close file 
fclose($handle);
$remove = array("\n", "\r\n", "\r");
$contents = str_replace($remove, ' ', $contents);
$data = preg_split('/[,? ]+/', $contents);

$eventname = $_POST['eventname'];
$series = $_POST['series'];
$year = $_POST['year'];
$finishposition = $data[18];
$qualposition = $data[19];
$drivernumber = $data[20];
$drivername = $data[21];
$laps = $data[22];
$lapsled = $data[23];
$points = $data[24];
$qualtime = $data[25];
$reasonout = $data[26];
$finishposition2 = $data[27];
$qualposition2 = $data[28];
$drivernumber2 = $data[29];
$drivername2 = $data[30];
$laps2 = $data[31];
$lapsled2 = $data[32];
$points2 = $data[33];
$qualtime2 = $data[34];
$reasonout2 = $data[35];
$finishposition3 = $data[36];
$qualposition3 = $data[37];
$drivernumber3 = $data[38];
$drivername3 = $data[39];
$laps3 = $data[40];
$lapsled3 = $data[41];
$points3 = $data[42];
$qualtime3 = $data[43];
$reasonout3 = $data[44];
$finishposition4 = $data[45];
$qualposition4 = $data[46];
$drivernumber4 = $data[47];
$drivername4 = $data[48];
$laps4 = $data[49];
$lapsled4 = $data[50];
$points4 = $data[51];
$qualtime4 = $data[52];
$reasonout4 = $data[53];
$finishposition5 = $data[54];
$qualposition5 = $data[55];
$drivernumber5 = $data[56];
$drivername5 = $data[57];
$laps5 = $data[58];
$lapsled5 = $data[59];
$points5 = $data[60];
$qualtime5 = $data[61];
$reasonout5 = $data[62];
$finishposition6 = $data[63];
$qualposition6 = $data[64];
$drivernumber6 = $data[65];
$drivername6 = $data[66];
$laps6 = $data[67];
$lapsled6 = $data[68];
$points6 = $data[69];
$qualtime6 = $data[70];
$reasonout6 = $data[71];
$finishposition7 = $data[72];
$qualposition7 = $data[73];
$drivernumber7 = $data[74];
$drivername7 = $data[75];
$laps7 = $data[76];
$lapsled7 = $data[77];
$points7 = $data[78];
$qualtime7 = $data[79];
$reasonout7 = $data[80];
$finishposition8 = $data[81];
$qualposition8 = $data[82];
$drivernumber8 = $data[83];
$drivername8 = $data[84];
$laps8 = $data[85];
$lapsled8 = $data[86];
$points8 = $data[87];
$qualtime8 = $data[88];
$reasonout8 = $data[89];
$finishposition9 = $data[90];
$qualposition9 = $data[91];
$drivernumber9 = $data[92];
$drivername9 = $data[93];
$laps9 = $data[94];
$lapsled9 = $data[95];
$points9 = $data[96];
$qualtime9 = $data[97];
$reasonout9 = $data[98];
$finishposition10 = $data[99];
$qualposition10 = $data[100];
$drivernumber10 = $data[101];
$drivername10 = $data[102];
$laps10 = $data[103];
$lapsled10 = $data[104];
$points10 = $data[105];
$qualtime10 = $data[106];
$reasonout10 = $data[107];
$finishposition11 = $data[108];
$qualposition11 = $data[109];
$drivernumber11 = $data[110];
$drivername11 = $data[111];
$laps11 = $data[112];
$lapsled11 = $data[113];
$points11 = $data[114];
$qualtime11 = $data[115];
$reasonout11 = $data[116];
$finishposition12 = $data[117];
$qualposition12 = $data[118];
$drivernumber12 = $data[119];
$drivername12 = $data[120];
$laps12 = $data[121];
$lapsled12 = $data[122];
$points12 = $data[123];
$qualtime12 = $data[124];
$reasonout12 = $data[125];
$finishposition13 = $data[126];
$qualposition13 = $data[127];
$drivernumber13 = $data[128];
$drivername13 = $data[129];
$laps13 = $data[130];
$lapsled13 = $data[131];
$points13 = $data[132];
$qualtime13 = $data[133];
$reasonout13 = $data[134];
$finishposition14 = $data[135];
$qualposition14 = $data[136];
$drivernumber14 = $data[137];
$drivername14 = $data[138];
$laps14 = $data[139];
$lapsled14 = $data[140];
$points14 = $data[141];
$qualtime14 = $data[142];
$reasonout14 = $data[143];
$finishposition15 = $data[144];
$qualposition15 = $data[145];
$drivernumber15 = $data[146];
$drivername15 = $data[147];
$laps15 = $data[148];
$lapsled15 = $data[149];
$points15 = $data[150];
$qualtime15 = $data[151];
$reasonout15 = $data[152];
$finishposition16 = $data[153];
$qualposition16 = $data[154];
$drivernumber16 = $data[155];
$drivername16 = $data[156];
$laps16 = $data[157];
$lapsled16 = $data[158];
$points16 = $data[159];
$qualtime16 = $data[160];
$reasonout16 = $data[161];
$finishposition17 = $data[162];
$qualposition17 = $data[163];
$drivernumber17 = $data[164];
$drivername17 = $data[165];
$laps17 = $data[166];
$lapsled17 = $data[167];
$points17 = $data[168];
$qualtime17 = $data[169];
$reasonout17 = $data[170];
$finishposition18 = $data[171];
$qualposition18 = $data[172];
$drivernumber18 = $data[173];
$drivername18 = $data[174];
$laps18 = $data[175];
$lapsled18 = $data[176];
$points18 = $data[177];
$qualtime18 = $data[178];
$reasonout18 = $data[179];
$finishposition19 = $data[180];
$qualposition19 = $data[181];
$drivernumber19 = $data[182];
$drivername19 = $data[183];
$laps19 = $data[184];
$lapsled19 = $data[185];
$points19 = $data[186];
$qualtime19 = $data[187];
$reasonout19 = $data[188];
$finishposition20 = $data[189];
$qualposition20 = $data[190];
$drivernumber20 = $data[191];
$drivername20 = $data[192];
$laps20 = $data[193];
$lapsled20 = $data[194];
$points20 = $data[195];
$qualtime20 = $data[196];
$reasonout20 = $data[197];
$finishposition21 = $data[198];
$qualposition21 = $data[199];
$drivernumber21 = $data[200];
$drivername21 = $data[201];
$laps21 = $data[202];
$lapsled21 = $data[203];
$points21 = $data[204];
$qualtime21 = $data[205];
$reasonout21 = $data[206];
$finishposition22 = $data[207];
$qualposition22 = $data[208];
$drivernumber22 = $data[209];
$drivername22 = $data[210];
$laps22 = $data[211];
$lapsled22 = $data[212];
$points22 = $data[213];
$qualtime22 = $data[214];
$reasonout22 = $data[215];
$finishposition23 = $data[216];
$qualposition23 = $data[217];
$drivernumber23 = $data[218];
$drivername23 = $data[219];
$laps23 = $data[220];
$lapsled23 = $data[221];
$points23 = $data[222];
$qualtime23 = $data[223];
$reasonout23 = $data[224];
$finishposition24 = $data[225];
$qualposition24 = $data[226];
$drivernumber24 = $data[227];
$drivername24 = $data[228];
$laps24 = $data[229];
$lapsled24 = $data[230];
$points24 = $data[231];
$qualtime24 = $data[232];
$reasonout24 = $data[233];
$finishposition25 = $data[234];
$qualposition25 = $data[235];
$drivernumber25 = $data[236];
$drivername25 = $data[237];
$laps25 = $data[238];
$lapsled25 = $data[239];
$points25 = $data[240];
$qualtime25 = $data[241];
$reasonout25 = $data[242];
$finishposition26 = $data[243];
$qualposition26 = $data[244];
$drivernumber26 = $data[245];
$drivername26 = $data[246];
$laps26 = $data[247];
$lapsled26 = $data[248];
$points26 = $data[249];
$qualtime26 = $data[250];
$reasonout26 = $data[251];
$finishposition27 = $data[252];
$qualposition27 = $data[253];
$drivernumber27 = $data[254];
$drivername27 = $data[255];
$laps27 = $data[256];
$lapsled27 = $data[257];
$points27 = $data[258];
$qualtime27 = $data[259];
$reasonout27 = $data[260];
$finishposition28 = $data[261];
$qualposition28 = $data[262];
$drivernumber28 = $data[263];
$drivername28 = $data[264];
$laps28 = $data[265];
$lapsled28 = $data[266];
$points28 = $data[267];
$qualtime28 = $data[268];
$reasonout28 = $data[269];
$finishposition29 = $data[270];
$qualposition29 = $data[271];
$drivernumber29 = $data[272];
$drivername29 = $data[273];
$laps29 = $data[274];
$lapsled29 = $data[275];
$points29 = $data[276];
$qualtime29 = $data[277];
$reasonout29 = $data[278];
$finishposition30 = $data[279];
$qualposition30 = $data[280];
$drivernumber30 = $data[281];
$drivername30 = $data[282];
$laps30 = $data[283];
$lapsled30 = $data[284];
$points30 = $data[285];
$qualtime30 = $data[286];
$reasonout30 = $data[287];
$finishposition31 = $data[288];
$qualposition31 = $data[289];
$drivernumber31 = $data[290];
$drivername31 = $data[291];
$laps31 = $data[292];
$lapsled31 = $data[293];
$points31 = $data[294];
$qualtime31 = $data[295];
$reasonout31 = $data[296];
$finishposition32 = $data[297];
$qualposition32 = $data[298];
$drivernumber32 = $data[299];
$drivername32 = $data[300];
$laps32 = $data[301];
$lapsled32 = $data[302];
$points32 = $data[303];
$qualtime32 = $data[304];
$reasonout32 = $data[305];
$finishposition33 = $data[306];
$qualposition33 = $data[307];
$drivernumber33 = $data[308];
$drivername33 = $data[309];
$laps33 = $data[310];
$lapsled33 = $data[311];
$points33 = $data[312];
$qualtime33 = $data[313];
$reasonout33 = $data[314];
$finishposition34 = $data[315];
$qualposition34 = $data[316];
$drivernumber34 = $data[317];
$drivername34 = $data[318];
$laps34 = $data[319];
$lapsled34 = $data[320];
$points34 = $data[321];
$qualtime34 = $data[322];
$reasonout34 = $data[323];
$finishposition35 = $data[324];
$qualposition35 = $data[325];
$drivernumber35 = $data[326];
$drivername35 = $data[327];
$laps35 = $data[328];
$lapsled35 = $data[329];
$points35 = $data[330];
$qualtime35 = $data[331];
$reasonout35 = $data[332];
$finishposition36 = $data[333];
$qualposition36 = $data[334];
$drivernumber36 = $data[335];
$drivername36 = $data[336];
$laps36 = $data[337];
$lapsled36 = $data[338];
$points36 = $data[339];
$qualtime36 = $data[340];
$reasonout36 = $data[341];
$finishposition37 = $data[342];
$qualposition37 = $data[343];
$drivernumber37 = $data[344];
$drivername37 = $data[345];
$laps37 = $data[346];
$lapsled37 = $data[347];
$points37 = $data[348];
$qualtime37 = $data[349];
$reasonout37 = $data[350];
$finishposition38 = $data[351];
$qualposition38 = $data[352];
$drivernumber38 = $data[353];
$drivername38 = $data[354];
$laps38 = $data[355];
$lapsled38 = $data[356];
$points38 = $data[357];
$qualtime38 = $data[358];
$reasonout38 = $data[359];
$finishposition39 = $data[360];
$qualposition39 = $data[361];
$drivernumber39 = $data[362];
$drivername39 = $data[363];
$laps39 = $data[364];
$lapsled39 = $data[365];
$points39 = $data[366];
$qualtime39 = $data[367];
$reasonout39 = $data[368];
$finishposition40 = $data[369];
$qualposition40 = $data[370];
$drivernumber40 = $data[371];
$drivername40 = $data[372];
$laps40 = $data[373];
$lapsled40 = $data[374];
$points40 = $data[375];
$qualtime40 = $data[376];
$reasonout40 = $data[377];
$finishposition41 = $data[378];
$qualposition41 = $data[379];
$drivernumber41 = $data[380];
$drivername41 = $data[381];
$laps41 = $data[382];
$lapsled41 = $data[383];
$points41 = $data[384];
$qualtime41 = $data[385];
$reasonout41 = $data[386];
$finishposition42 = $data[387];
$qualposition42 = $data[388];
$drivernumber42 = $data[389];
$drivername42 = $data[390];
$laps42 = $data[391];
$lapsled42 = $data[392];
$points42 = $data[393];
$qualtime42 = $data[394];
$reasonout42 = $data[395];
$finishposition43 = $data[396];
$qualposition43 = $data[397];
$drivernumber43 = $data[398];
$drivername43 = $data[399];
$laps43 = $data[400];
$lapsled43 = $data[401];
$points43 = $data[402];
$qualtime43 = $data[403];
$reasonout43 = $data[404];
$racetime = $data[408];
$avgspeed = $data[412];
$marginofvictory = $data[417];
$cautionflag = $data[421];
$leadchanges = $data[427];
$weather = $data[430];
$temp = $data[431];
$winddir = $data[432];
$windspeed = $data[433];

$the_query = "INSERT INTO `s1racestats` (`eventname`, `firstplace`, `finishposition`, `top10`, `top5`, `drivernumber`, `drivername`, `laps`, `lapsled`, `points`, `qual1stplace`, `qualposition`, `qualtime`, `reasonout`, `prov`, `didnotstart`, `year`)
VALUES ('$eventname', 1, $finishposition, 1, 1, $drivernumber, '$drivername', $laps, $lapsled, $points, 1, $qualposition, $qualtime, '$reasonout', 0, 1, $year), ('$eventname', 0, $finishposition2, 1, 1, $drivernumber2, '$drivername2', $laps2, $lapsled2, $points2, 0, $qualposition2, $qualtime2, '$reasonout2', 0, 1, $year), ('$eventname', 0, $finishposition3, 1, 1, $drivernumber3, '$drivername3', $laps3, $lapsled3, $points3, 0, $qualposition3, $qualtime3, '$reasonout3', 0, 1, $year), ('$eventname', 0, $finishposition4, 1, 1, $drivernumber4, '$drivername4', $laps4, $lapsled4, $points4, 0, $qualposition4, $qualtime4, '$reasonout4', 0, 1, $year), ('$eventname', 0, $finishposition5, 1, 1, $drivernumber5, '$drivername5', $laps5, $lapsled5, $points5, 0, $qualposition5, $qualtime5, '$reasonout5', 0, 1, $year), ('$eventname', 0, $finishposition6, 1, 0, $drivernumber6, '$drivername6', $laps6, $lapsled6, $points6, 0, $qualposition6, $qualtime6, '$reasonout6', 0, 1, $year), ('$eventname', 0, $finishposition7, 1, 0, $drivernumber7, '$drivername7', $laps7, $lapsled7, $points7, 0, $qualposition7, $qualtime7, '$reasonout7', 0, 1, $year), ('$eventname', 0, $finishposition8, 1, 0, $drivernumber8, '$drivername8', $laps8, $lapsled8, $points8, 0, $qualposition8, $qualtime8, '$reasonout8', 0, 1, $year), ('$eventname', 0, $finishposition9, 1, 0, $drivernumber9, '$drivername9', $laps9, $lapsled9, $points9, 0, $qualposition9, $qualtime9, '$reasonout9', 0, 1, $year), ('$eventname', 0, $finishposition10, 1, 0, $drivernumber10, '$drivername10', $laps10, $lapsled10, $points10, 0, $qualposition10, $qualtime10, '$reasonout10', 0, 1, $year), ('$eventname', 0, $finishposition11, 0, 0, $drivernumber11, '$drivername11', $laps11, $lapsled11, $points11, 0, $qualposition11, $qualtime11, '$reasonout11', 0, 1, $year), ('$eventname', 0, $finishposition12, 0, 0, $drivernumber12, '$drivername12', $laps12, $lapsled12, $points12, 0, $qualposition12, $qualtime12, '$reasonout12', 0, 1, $year), ('$eventname', 0, $finishposition13, 0, 0, $drivernumber13, '$drivername13', $laps13, $lapsled13, $points13, 0, $qualposition13, $qualtime13, '$reasonout13', 0, 1, $year), ('$eventname', 0, $finishposition14, 0, 0, $drivernumber14, '$drivername14', $laps14, $lapsled14, $points14, 0, $qualposition14, $qualtime14, '$reasonout14', 0, 1, $year), ('$eventname', 0, $finishposition15, 0, 0, $drivernumber15, '$drivername15', $laps15, $lapsled15, $points15, 0, $qualposition15, $qualtime15, '$reasonout15', 0, 1, $year), ('$eventname', 0, $finishposition16, 0, 0, $drivernumber16, '$drivername16', $laps16, $lapsled16, $points16, 0, $qualposition16, $qualtime16, '$reasonout16', 0, 1, $year), ('$eventname', 0, $finishposition17, 0, 0, $drivernumber17, '$drivername17', $laps17, $lapsled17, $points17, 0, $qualposition17, $qualtime17, '$reasonout17', 0, 1, $year), ('$eventname', 0, $finishposition18, 0, 0, $drivernumber18, '$drivername18', $laps18, $lapsled18, $points18, 0, $qualposition18, $qualtime18, '$reasonout18', 0, 1, $year), ('$eventname', 0, $finishposition19, 0, 0, $drivernumber19, '$drivername19', $laps19, $lapsled19, $points19, 0, $qualposition19, $qualtime19, '$reasonout19', 0, 1, $year), ('$eventname', 0, $finishposition20, 0, 0, $drivernumber20, '$drivername20', $laps20, $lapsled20, $points20, 0, $qualposition20, $qualtime20, '$reasonout20', 0, 1, $year), ('$eventname', 0, $finishposition21, 0, 0, $drivernumber21, '$drivername21', $laps21, $lapsled21, $points21, 0, $qualposition21, $qualtime21, '$reasonout21', 0, 1, $year), ('$eventname', 0, $finishposition22, 0, 0, $drivernumber22, '$drivername22', $laps22, $lapsled22, $points22, 0, $qualposition22, $qualtime22, '$reasonout22', 0, 1, $year), ('$eventname', 0, $finishposition23, 0, 0, $drivernumber23, '$drivername23', $laps23, $lapsled23, $points23, 0, $qualposition23, $qualtime23, '$reasonout23', 0, 1, $year), ('$eventname', 0, $finishposition24, 0, 0, $drivernumber24, '$drivername24', $laps24, $lapsled24, $points24, 0, $qualposition24, $qualtime24, '$reasonout24', 0, 1, $year), ('$eventname', 0, $finishposition25, 0, 0, $drivernumber25, '$drivername25', $laps25, $lapsled25, $points25, 0, $qualposition25, $qualtime25, '$reasonout25', 0, 1, $year), ('$eventname', 0, $finishposition26, 0, 0, $drivernumber26, '$drivername26', $laps26, $lapsled26, $points26, 0, $qualposition26, $qualtime26, '$reasonout26', 0, 1, $year), ('$eventname', 0, $finishposition27, 0, 0, $drivernumber27, '$drivername27', $laps27, $lapsled27, $points27, 0, $qualposition27, $qualtime27, '$reasonout27', 0, 1, $year), ('$eventname', 0, $finishposition28, 0, 0, $drivernumber28, '$drivername28', $laps28, $lapsled28, $points28, 0, $qualposition28, $qualtime28, '$reasonout28', 0, 1, $year), ('$eventname', 0, $finishposition29, 0, 0, $drivernumber29, '$drivername29', $laps29, $lapsled29, $points29, 0, $qualposition29, $qualtime29, '$reasonout29', 0, 1, $year), ('$eventname', 0, $finishposition30, 0, 0, $drivernumber30, '$drivername30', $laps30, $lapsled30, $points30, 0, $qualposition30, $qualtime30, '$reasonout30', 0, 1, $year), ('$eventname', 0, $finishposition31, 0, 0, $drivernumber31, '$drivername31', $laps31, $lapsled31, $points31, 0, $qualposition31, $qualtime31, '$reasonout31', 0, 1, $year), ('$eventname', 0, $finishposition32, 0, 0, $drivernumber32, '$drivername32', $laps32, $lapsled32, $points32, 0, $qualposition32, $qualtime32, '$reasonout32', 0, 1, $year), ('$eventname', 0, $finishposition33, 0, 0, $drivernumber33, '$drivername33', $laps33, $lapsled33, $points33, 0, $qualposition33, $qualtime33, '$reasonout33', 0, 1, $year), ('$eventname', 0, $finishposition34, 0, 0, $drivernumber34, '$drivername34', $laps34, $lapsled34, $points34, 0, $qualposition34, $qualtime34, '$reasonout34', 0, 1, $year), ('$eventname', 0, $finishposition35, 0, 0, $drivernumber35, '$drivername35', $laps35, $lapsled35, $points35, 0, $qualposition35, $qualtime35, '$reasonout35', 0, 1, $year), ('$eventname', 0, $finishposition36, 0, 0, $drivernumber36, '$drivername36', $laps36, $lapsled36, $points36, 0, $qualposition36, $qualtime36, '$reasonout36', 0, 1, $year), ('$eventname', 0, $finishposition37, 0, 0, $drivernumber37, '$drivername37', $laps37, $lapsled37, $points37, 0, $qualposition37, $qualtime37, '$reasonout37', 0, 1, $year), ('$eventname', 0, $finishposition38, 0, 0, $drivernumber38, '$drivername38', $laps38, $lapsled38, $points38, 0, $qualposition38, $qualtime38, '$reasonout38', 0, 1, $year), ('$eventname', 0, $finishposition39, 0, 0, $drivernumber39, '$drivername39', $laps39, $lapsled39, $points39, 0, $qualposition39, $qualtime39, '$reasonout39', 0, 1, $year), ('$eventname', 0, $finishposition40, 0, 0, $drivernumber40, '$drivername40', $laps40, $lapsled40, $points40, 0, $qualposition40, $qualtime40, '$reasonout40', 0, 1, $year), ('$eventname', 0, $finishposition41, 0, 0, $drivernumber41, '$drivername41', $laps41, $lapsled41, $points41, 0, $qualposition41, $qualtime41, '$reasonout41', 0, 1, $year), ('$eventname', 0, $finishposition42, 0, 0, $drivernumber42, '$drivername42', $laps42, $lapsled42, $points42, 0, $qualposition42, $qualtime42, '$reasonout42', 0, 1, $year), ('$eventname', 0, $finishposition43, 0, 0, $drivernumber43, '$drivername43', $laps43, $lapsled43, $points43, 0, $qualposition43, $qualtime43, '$reasonout43', 0, 1, $year)";

$the_query2 = "INSERT INTO `eventstats` (`eventname`, `series`, `racetime`, `avgspeed`, `weather`, `temp`, `winddir`, `windspeed`, `marginofvictory`, `cautionflag`, `leadchanges`, `year`)
VALUES ('$eventname', '$series', $racetime, '$avgspeed', '$weather', '$temp', '$winddir', '$windspeed', '$marginofvictory', $cautionflag, $leadchanges, $year)";

mysql_query($the_query) or die ('Error in result: '. mysql_error());

Echo $the_query;

mysql_query($the_query2) or die ('Error in result: '. mysql_error());

Echo $the_query2;
}
?>

 

The text file looks like this:

Race Final                              Daytona

                         2.500 miles    200 laps

--------------------------------------------------------------------------------

Fin Str      Driver                     Laps  Led   Pts     Qual   Reason Out

--------------------------------------------------------------------------------

1   1    9  BillMurphy                 200  128   180  193.790      Running

2  13   47  MarcosAmbrose              200   32   180  191.762      Running

3   4    5  MarkMartin-A               200   16   170  192.283      Running

4   2   16  GregBiffle                 200    1   165  192.682      Running

5  11   44  AJAllmendinger-B           200    0   155  191.766      Running

6  19   39  RyanNewman                 200    1   155  191.513      Running

7  12   29  KevinHarvick               200   15   151  191.766      Running

8   7   14  TonyStewart                200    0   142  192.012      Running

9   8   19  ElliottSadler              200    0   138  192.012      Running

10  28   82  ScottSpeed                 200    1   139  191.103      Running

11  26   34  JohnAndretti               200    0   130  191.188      Running

12  40   55  MichaelWaltrip             200    0   127  189.681      Running

13  16    8  AricAlmirola               200    0   124  191.685      Running

14  22    7  RobbyGordon                200    4   126  191.342      Running

15  37   96  BobbyLabonte               200    0   118  190.009      Running

16  18   24  JeffGordon                 200    1   120  191.534      Running

17  29   87  JoeNemcheck                200    0   112  191.013      Running

18  15   36  ScottRiggs                 199    0   109  191.701      Running

19  38   42  JuanMontoya-A              199    0   106  189.833      Running

20  30  100  DavidReutimann             199    0   103  190.900      Running

21   5   43  ReedSorenson-A             199    0   100  192.266      Running

22  21    9  KaseyKane                  199    0    97  191.428      Running

23   3    2  KurtBusch                  199    0    94  192.361      Running

24  25   66  DaveBlaney                 199    0    91  191.237      Running

25  14   71  DavidGilliland             199    0    88  191.701      Running

26  24   26  JamieMcMurray-A            199    1    90  191.257      Running

27  17   83  BrianVickers               199    0    82  191.562      Running

28  23   77  SamHornishJr.             199    0    79  191.306      Running

29  39   88  DaleEarnhardtJr-A         199    0    76  189.749      Running

30  42   33  ClintBowyer                198    0    73  188.623      Running

31  10   48  JimmieJohnson              197    0    70  191.803      Running

32  41   41  JeremyMayfield             196    0    67  189.222      Running

33  31    1  MartinTruexJr.            196    0    64  190.617      Running

34  43   17  MattKenseth                196    0    61  188.186      Running

35  36   11  DennyHamlin                196    0    58  190.134      Running

36  34   12  DavidStremme               195    0    55  190.488      Running

37  35    6  DavidRagan                 194    0    52  190.182      Running

38  27   98  PaulMenard                 192    0    49  191.139      Running

39  32   20  JoeyLogano                 190    0    46  190.560      Running

40   9   18  KyleBusch                  153    0    43  191.889       Header

41  33   31  JeffBurton                 139    0    40  190.508   Electrical

42  20  107  CaseyMears                 138    0    37  191.452      Gearbox

43   6   99  CarlEdwards                 84    0    34  192.139   Electrical





Race time - 165:51.515



Average speed - 180.879mph



Margin of victory - 1.747sec



Caution flags - 2



# of lead changes - 17



Weather - Clear 76^ NW 6mpÈ


 

Your help is really appreciated, I know the code for the php file is quite large but only the last part is where I am getting the issue (I think)

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/194974-error-in-syntax/
Share on other sites

Based on where the error is occurring at (i.e. the part of the query that is printed in the error message), the problem is  in the $racetime value. Assuming that the column receiving that value is either a TIME or a character data type, you need to put single quotes around the value in the query.

Link to comment
https://forums.phpfreaks.com/topic/194974-error-in-syntax/#findComment-1025146
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.