PHP错误406不可接受

时间:2014-02-04 10:04:29

标签: php mysql

这是我的代码。每次我在$ sunrise之前将$ _POST [maxhu]的值放下来,我得到一个406错误,说 Not Acceptable

问题是,如果我在其上放置单个字符,它会起作用,但如果我放一个字符串,它就不会。

$saving="INSERT INTO tblforecast (Issued,Valid,Synopsis,Forecast,Local_Forecast,Station11,Station12,Station13,Station14,Station15,Station16,Station17,Station18,Station19,MaxTempYes,MaxTempTod,HighTide,LowTide,MaxHum,MinHum,Illuminate,Sunrise,Sunset,Moonrise,Moonset,Forecaster)
                               VALUES (
                               now(),
                               $_POST[ThisType],
                               '$syn',
                               '$fore',
                               '$localfore',
                               '{$_SESSION['STemp'][0]},{$_SESSION['SCond'][0]},{$_POST['wsc1']}',
                               '{$_SESSION['STemp'][1]},{$_SESSION['SCond'][1]},{$_POST['wsc2']}',
                               '{$_SESSION['STemp'][2]},{$_SESSION['SCond'][2]},{$_POST['wsc3']}',
                               '{$_SESSION['STemp'][3]},{$_SESSION['SCond'][3]},{$_POST['wsc4']}',
                               '{$_SESSION['STemp'][4]},{$_SESSION['SCond'][4]},{$_POST['wsc5']}',
                               '{$_SESSION['STemp'][5]},{$_SESSION['SCond'][5]}{$_POST['wsc6']}',
                               '{$_SESSION['STemp'][6]},{$_SESSION['SCond'][6]},{$_POST['wsc7']}',
                               '{$_SESSION['STemp'][7]},{$_SESSION['SCond'][7]},{$_POST['wsc8']}',
                               '{$_SESSION['STemp'][8]},{$_SESSION['SCond'][8]},
                               {$_POST['wsc9']}',
                               '$_POST[maxtempyes]',
                               '$_POST[maxtemptod]',
                               '$_POST[hightide]',
                               '$_POST[lowtide]',
                               '$_POST[maxhu]',
                               '$_POST[minhu]',
                               '$_POST[illuminati]',
                               '$sunrise',
                               '$sunset',
                               '$moonrise',
                               '$moonset',
                               $id)";

                $save = mysql_query($saving);

那有什么不对?

1 个答案:

答案 0 :(得分:-1)

尝试这样可能有效......

`$saving="INSERT INTO tblforecast (Issued,Valid,Synopsis,Forecast,Local_Forecast,Station11,Station12,Station13,Station14,Station15,Station16,Station17,Station18,Station19,MaxTempYes,MaxTempTod,HighTide,LowTide,MaxHum,MinHum,Illuminate,Sunrise,Sunset,Moonrise,Moonset,Forecaster)
                         VALUES (
                         now(),
                         $_POST[ThisType],
                         '$syn',
                         '$fore',
                         '$localfore',
                         '".{$_SESSION['STemp'][0]}.",".{$_SESSION['SCond'][0]}.",".{$_POST['wsc1']}."',
                         '".{$_SESSION['STemp'][1]}.",".{$_SESSION['SCond'][1]}.",".{$_POST['wsc2']}."',
                         '".{$_SESSION['STemp'][2]}.",".{$_SESSION['SCond'][2]}.",".{$_POST['wsc3']}."',
                         '".{$_SESSION['STemp'][3]}.",".{$_SESSION['SCond'][3]}.",".{$_POST['wsc4']}."',
                         '".{$_SESSION['STemp'][4]}.",".{$_SESSION['SCond'][4]}.",".{$_POST['wsc5']}."',
                         '".{$_SESSION['STemp'][5]}.",".{$_SESSION['SCond'][5]}.",".{$_POST['wsc6']}."',
                         '".{$_SESSION['STemp'][6]}.",".{$_SESSION['SCond'][6]}.",".{$_POST['wsc7']}."',
                         '".{$_SESSION['STemp'][7]}.",".{$_SESSION['SCond'][7]}.",".{$_POST['wsc8']}."',
                         '".{$_SESSION['STemp'][8]}.",".{$_SESSION['SCond'][8]}.",".{$_POST['wsc9']}."',
                         '".$_POST[maxtempyes]."',
                         '".$_POST[maxtemptod]."',
                         '".$_POST[hightide]."',
                         '".$_POST[lowtide]."',
                         '".$_POST[maxhu]."',
                         '".$_POST[minhu]."',
                         '".$_POST[illuminati]."',
                         '$sunrise',
                         '$sunset',
                         '$moonrise',
                         '$moonset',
                         $id)";`