I getting error "Query error!" with this code:
$result = $connection->query("INSERT INTO EMP_TBLE (NAME, AGE, CATEGORY, UPDATE_COUNT) VALUES('$NAME', '$AGE', $CAT, 1
ON DUPLICATE KEY UPDATE UPDATE_COUNT = UPDATE_COUNT + 1"));
echo "<br>".$result;die;
I also check different example like this example was running success but I found error in above code for my demo project.
$NAMEand$AGEetc from? If these are from user input, be careful about SQL injection. You should be using parameter binding here.NAME