Got error Undefined id - on the page

Without using curley braces the if statement is only going to extend to the next line so the query still runs whether the GET id parameter is set or not. It is a poor practice in Php to not use them and can easily cause problems as you see. It is also harder to read the code.

2 Likes