Here's an odd one I haven't encountered before. A Laravel 4 site I was working on was recently deployed to a production server running IIS/PHP 5.5.11. Everything seemed great until I started posting forms. I started receiving errors such as:
Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column '/admin/settings/1' in 'field list' (SQL: update `settings` set `updated_at` = 2015-07-17 08:40:41, `/admin/settings/1` = where `id` = 1)' in C:\{application_directory}\vendor\laravel\framework\src\Illuminate\Database\Connection.php:625
After some digging, I discovered that the PHP $_GET superglobal variable contains the path, as an index, on every page request in my application. For example, I dumped out the index view of my Settings admin page and received:
Array
(
[/admin/settings] =>
)
Naturally, as I use Laravel's Input::all()
on all form posts which pulls in a combination of both the $_GET/$_POST vars and therefore when it attempts to run the update query, an additional index (without a value) is being passed.
Any ideas? I've checked into IIS's rewrite module, PHP settings, performed a bunch of Google searches to get additional information and I'm running out of options.