-2

This is my code. Everytime I put values on the $_POST[maxhu] down before $sunrise, I get a 406 Error saying Not Acceptable .

The question is that, if I put single characters on it, it will work but if I put a string, it doesn't.

$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);

So what is wrong?

Clary
  • 15
  • 5
  • Please read this: http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php?rq=1 – Matteo Tassinari Feb 04 '14 at 10:19
  • Your "406 Not Acceptable" is thrown somewhere in your code, but that position is not in the code you provided. Second, I would guess that it has something to do with the table definition, which also isn't included in the question. – Alexander Feb 04 '14 at 14:58
  • @Alexander how will I know which part of the code is the problem? – Clary Feb 05 '14 at 11:39

1 Answers1

-1

Try like this it might works...

`$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)";`
PatomaS
  • 1,603
  • 18
  • 25
Phoenix
  • 1,470
  • 17
  • 23
  • Not really a solution, since you haven't included any explanations, and it is not self-explanatory. – pdu Feb 04 '14 at 10:22