Most of your problems are PHP scope related, among other things. You define $conn inside the Delete() function then you try to use it outside of that function. You can't do that in PHP or any other language I know about. Variables defined in functions are only available to that function (unless you return the value). Also, in PHP global scope is different than in Javascript.

You create a database connection using PDO but then you try to use 'mysql*' methods. PDO has it's own methods, use them instead.

You didn't post the correct page for the 1st error message so I can't look into that.

Most of your problems are PHP scope related, among other things. You define $conn inside the Delete() function then you try to use it outside of that function. You can't do that in PHP or any other language I know about. Variables defined in functions are only available to that function (unless you return the value). Also, in PHP global scope is different than in Javascript.

You create a database connection using PDO but then you try to use 'mysql*' methods. PDO has it's own methods, use them instead.

You didn't post the correct page for the 1st error message so I can't look into that.

Instead of creating your database connection in a function I would recommend you create a class and use it. This is a nice tutorial of doing that, here. You still have a lot of research to do concerning PHP.