```
 string ip_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

        MySqlCommand cmd = new MySqlCommand("insert into ip_table (ip_addr,ip_date) values (@ip_addr,@ip_date) ON DUPLICATE KEY UPDATE ip_hitcount = ip_hitcount + 1 , ip_date = " + ip_date, con);

        cmd.Parameters.AddWithValue("@ip_addr", ipaddress);
        cmd.Parameters.AddWithValue("@ip_date", ip_date);

        cmd.ExecuteNonQuery();

```

> 
> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '02:04:50' at line 1 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '02:04:50' at line 1
>  what is wrong with this code? 
> 
> 
>