Relatively new to PHP (and now retired so teaching myself as I go)
I am trying to go down the PDO route, as I think it is more secure than mysqli.
I have been looking at example code and when it comes to form actions (ie. loading data from table, updating table or deleting rows) some examples have all the PHP code on the same page as the form, and some examples have some of the code, usually the form loading, on the same page, but the POST action as a separate PHP page.
My question is: 1) which is the best way to go, all on one page, or call separate page, and 2) why?
Cheers
I am trying to go down the PDO route, as I think it is more secure than mysqli.
I have been looking at example code and when it comes to form actions (ie. loading data from table, updating table or deleting rows) some examples have all the PHP code on the same page as the form, and some examples have some of the code, usually the form loading, on the same page, but the POST action as a separate PHP page.
My question is: 1) which is the best way to go, all on one page, or call separate page, and 2) why?
Cheers