-1

this is my first queston i ask, its about this code:

<?php
date_default_timezone_set('America/Santiago);
$fecha=date('Y-m-d');
$hora=date('H:i:s');
$link=mysqli_connect('localhost','root','','evaluacion2');
$sql="INSERT INTO sensores SET temperatura=".$_GET['celsius'].",distancia=".
$_GET['distancia'].",fecha='".$fecha."',hora='".$hora."'";
mysqli_query($link,$sql);
?> 

i try to insert from the URL

http://localhost/sensores/capturadatos.php?temperatura=3&distancia=12

but i get this message

Parse error: syntax error, unexpected 'Y' (T_STRING) in D:\wamp64\www\sensores\capturadatos.php on line 3

Rigo_158
  • 3
  • 3

1 Answers1

1

Replace date_default_timezone_set('America/Santiago);

to date_default_timezone_set('America/Santiago');

cn007b
  • 16,596
  • 7
  • 59
  • 74