denverpost / skireport

The Denver Post's Ski Report. Established 2007. http://denverpost.com/skireport
http://denverpost.com/skireport
MIT License
0 stars 0 forks source link

update.php's throwing a SQL error: #11

Closed freejoe76 closed 8 years ago

freejoe76 commented 8 years ago

ERROR 1064 (42000) at line 2: 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 ' , 'N/A, N/A', , 0, , '', 0, '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', 0, '', STR_' at line 3

freejoe76 commented 8 years ago

This happens when a resort isn't open yet -- its basedepth_in, topdepth_in fields are blank, creating invalid sql such as

    INSERT INTO report
        ( skiarea_id, newsnow_24_in, newsnow_48_in, newsnow_72_in, basedepth_in, topdepth_in, conditions, numliftsopen, numliftstotal, perliftsopen, numberofruns, acresopen, kmxc, eventnotices, cc_facilities, cc_numberoftrails, cc_kmopen, cc_kmtrackset, cc_kmskategroomed, sb_parkresshaped, sb_piperecut, sb_hits, sb_pipes, basetemperature_f, basetemperature_c, baseweather, lastupdate, open )
        VALUES ( 20, 0, 0, 1, 18, 18, 'Machine Made, Packed Powder', 1, 0, 0, '2', 38, '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '20', 0, 'Partly Cloudy', STR_TO_DATE('2015-11-09T14:48:02Z', '%Y-%m-%dT%H:%i:%s'), '' ),
( 25, 0, 0, 0, , , 'N/A, N/A', , 0, , '', 0, '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', 0, '', STR_TO_DATE('2015-11-05T17:11:38Z', '%Y-%m-%dT%H:%i:%s'), '' ),

(final line is the invalid sql, 5th and 6th items in the insert)

freejoe76 commented 8 years ago

Also erroring: numliftsopen, perliftsopen

freejoe76 commented 8 years ago

Yea! http://www.denverpost.com/skireport is live!