Dereksdontrun;11019961 wrote:Thanks for clarifying that Traq...would i be correct in thinking that -> is object oriented php and that i have been learning procedural php, hence my unfamiliarity with it?
yes, Object-Oriented.
I don't know what "kind" of PHP you've been learning 🙂
Dereksdontrun;11019961 wrote:I try to read stuff about OOP, classes, methods and objects but lose the will to live shortly afterwards.
Is it acceptable practice to code using a procedural style, if i am happy to do so? will i be seen as a 'lesser' coder?
perfectly acceptable.
I wouldn't be afraid of OOP, however. Very useful. mysqli is object-oriented (the mysqli_*() functions only alias the object methods), so you have an opportunity for plenty of practice. Likewise, if you use much javascript (especially a library, like jQuery), you've probably been using OOP without realizing it.
Dereksdontrun;11019961 wrote:Likewise if i mix my html and php and dont use MVC. Im not a professional coder but it works so should I be more relaxed in my approach rather than confuse myself with trying to learn best practice?
I'd recommend not avoiding best practices. (They're called "Best" for a reason, after all.)
(However, as noted above, that doesn't mean that you have to be Object-Oriented.)
I'd highly recommend not mixing HTML and PHP.
It can cause problems that are hard to track, limit your error handling (& recovery), and just generally has a tendency to get "messy." I strive to do all of my PHP logic/processing first, and all output last. [an example.]