Send data to MySQL (Arduino Uno, Eth shield W5100, IR obstacle sensor) [solved]

OK. I think the problem is now clear from comparing the log files. The first one fails. The other 2 work.

192.168.0.127 - - [05/May/2018:15:41:55 +0800] "GET /arduino/getdata.php?sensor1=1&sensor2=1&sensor3=1 HTTP/1.1Host:" 400 311

192.168.0.121 - - [05/May/2018:17:14:35 +0800] "GET /arduino/getdata.php?sensor1=1&sensor2=1&sensor3=1 HTTP/1.1" 200 7
192.168.0.142 - - [05/May/2018:17:15:23 +0800] "GET /arduino/getdata.php?sensor1=10&sensor2=20&sensor3=30 HTTP/1.1" 200 7

Change:

client.print(" HTTP/1.1");
client.println("Host: 192.168.0.121");

to by adding a new println():

client.print(" HTTP/1.1");
client.println();   // new
client.println("Host: 192.168.0.121");