Just me thinking out loud.

Almost every post i read starts with “I’m new to PHP…” followed shortly after with “and i can’t figure this out”
Then, scrolling down through the code that’s been posted I see they are trying to write a script for financial transactions or the next ebay etc. and all the while they are using mysql_* functions! :o :o

Reds top tip: Trying to run before you can walk will end up with a bloody nose!!

Ok, what am I getting at?
The point I’m making is, more often than not, you’re here because you need help.
Don’t let anyone - including me - tell you that you can’t build whatever it is you want to build, but before you try and build that thing, understand PHP - what it can/can’t do.
Start by writing forms - heck the internet is what it is today because of the very first form! No kidding! This opened the door to ‘user interactive websites’ and the rest as they say, is history.

Once you understand forms, look at uploading files, arrays, functions. When you’re comfortable with that lot, look at OOP and classes. This is when it gets really interesting and you can do some really cool stuff, but only when you understand what’s happening, when, where and how.
As a sidenote, I’d been writing PHP for around 3 years before I wrote my first store and probably another 2 years on top of that before I had the kahunas to use it in a live environment!

Take your time, get to know PHP, come to love it and it will love you back! (well, you get my drift)

Anyhow, that’s my little pearl of wisdom for today,
Peace x

Feel free to send your answers on a postcard to Redscouse - on second thoughts, just post them below :slight_smile:

It might also be good to remember when answering these threads that we definitly do not want to demotivate people. Rome wasn’t built in one day, and as long as you’re writing code you are continuously learning a craft that could result in countless hours of joy, paid work and helping others.

That beeing said…

Please remember that code you push online will run on the infrastructure of other people (your hosting provider and the internet itself). When you are a developer you are part of “the responsible”. It’s up to us to keep security issues, surveillance and other nastyness at bay.

It will be an interesting time when mysql_* gets removed. It’s a shame all the old stuff still tops the charts when searching because - from a learners point of view, i’d expect the stuff i’m learning from is valid, only to spend x months studying then arrive at a forum such as this to find everything i’ve learned is useless/bad/old. (choose your own).

If my original post came across like i was demotivating people then i need to work on my interaction skills because, quite the opposite was meant to be projected = Learn php, love php and it will serve you well.

Red :wink:

While demotivation is a factor, several coders come in thinking that this is easy. I play games so I can easily write the next Halo. I know how to search the web and use Facebook so I will create a better one.

What they completely leave out/ forget/ it doesn’t apply to them is, those things take lots of experience which is only gained over time; they are built by teams of skilled people over time, or at least a single person over a longer time period; Logic is something that is not easily learned;

Search engines keep old tutorials for a while, Dreamweave still uses outdated code. It is going to be very interesting when mysql_ functions are removed and new users come trying to find out why it doesn’t work at all!

not at all, was thinking responses in general. perhaps it’s me that have to clean up my interaction skills :stuck_out_tongue:

Phew! Thought i’d been a little naughty in my post for a while ;D

Indeed! :slight_smile:
I still have Dreamweaver installed. I’m not sure if it’s for sentimental reasons as i do all my coding in Eclipse nowdays - how did i not discover this little gem earlier?

When they finally remove mysql, i’d hazard a guess and say around a third of websites will cease to work and that’s me being conservative with my figures. Imagine selling a website on 31st October for £1000+ and it stops working on Nov 5th - makes for an interesting future.

You’ve also got to remember the time span from the new PHP release to the hosting providers upgrading. Since many of these are stuck at PHP 5.2 / 5.3 I say it’s not happening any time soon :stuck_out_tongue:

It will be an interesting time when mysql_* gets removed.

I anticipate my workload/income to quadruple at that time. By the way, welcome back [member=71845]JimL[/member]

lucrative times ahead :slight_smile:

[member=26967]Redscouse[/member] , What funny, is that people are still starting NEW projects using deprecated code. Part of the problem is there are so many tutorials out there that use old code. The only thing that will really change things is when the old code just plain wont work. A little ways off, but on the way.

[member=46186]Kevin Rubio[/member] I couldn’t agree more. The sooner they remove it the better the code will be produced.

I don’t know if I agree with that. People will still hack somethings together that will be just as bad. Never underestimate the power of the ill informed or just plain stupidity of some people. Some will learn and thrive others will complain and bypass a prepared statement, sadly we have already witnessed it.

Removing the old code will likely show flaws in what we currently use, however. And anything that makes a real programmer better is well received.

anything that makes a real programmer better is well received

What gets me is when you point out the other problems with someones posted code and they come back at you with the “That’s not the problem I posted about” attitude. You would think someone would want to know about other issues with their code so they could learn, make improvements and be a better programmer.

I think part of the problem we see with spaghetti code in PHP is the forgiving nature of writing the code. Looking back to when i learned i wish there were some kind of rules - and i don’t mean coding standards etc.
Anyone who uses Python learns quickly that how you write the code becomes very important. With indentation being part of the structure instead of {} then mine, yours and Kevin’s code is all pretty much laid out the same so anyone coming along afterwards well, if they can read one script they can read them all - may not understand it but they can sure read it.

One of PHP flaws i think…

I have always thought there should not be so many ways to do the same exact thing in PHP.

Sponsor our Newsletter | Privacy Policy | Terms of Service