require_once("config.php"); $sql = "SELECT * FROM test WHERE id = 1;"; $result = mysql_query($sql); $num_record = mysql_num_rows($result); while ($test = mysql_fetch_row($result)) { echo "output="; echo "$test[1]"; }
void loop() { if (client.available()) { char c = client.find("output="); Serial.write(c); } if (millis() - lastConnectionTime > postingInterval) { httpRequest(); if(client.find("")){ client.find("output="); value = client.parseFloat(); Serial.print("Output = "); Serial.println(value); } } } void httpRequest() { client.stop(); if (client.connect(server, 80)) { Serial.println("connecting..."); client.println("GET /~file/readmysql/index.php HTTP/1.1"); client.println("Host: www.arduino.cc"); client.println("User-Agent: arduino-ethernet"); client.println("Connection: close"); client.println(); lastConnectionTime = millis(); } else { Serial.println("connection failed"); } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง