SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Still haviing problems with PHP code

    I have been trying to teach myself PHP on and off for a couple of months now. I still have a problem understanding every line of code from my Yank Sitepoint book, and another book I have purchashed (PHP and MySQL for dynamic websites Larry Allman). Both, I'm sure, are excellent books, but I still have difficulty digesting PHP coding techniques. In particularly the multiple techniques that can be used concerning arrays, varibles, and conditional statements.Both books teach in an entirely different manner. Is this a case of practice makes perfect? I find myself going back to the beginning of both books and starting the exercises over when I see something in the code that is not recognizable. My goal is to understand, not just copy an example from one of my books and alter the programming for my site. It can be very frustrating. PHP & MySQL are essential to making my website a reality. Can anyone give me some suggestions?

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hire someone else? Some people just don't have a programming mind.

    If you find you're not understanding the way a book is teaching something, you can only try a different book - all writers have different styles to impart knowledge, some will work for you and some won't.

    If there's something specific you are struggling to get your head around, post it here.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2007
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have any programming knowledge or PHP your first experience with programming? If you don't have any experience it might be better going for a simpler book such as Programming PHP (O'Reilly). There's also a load of beginner tutorials online (just type "php tutorials" into Google).

    My advice is to start simple - don't expect too much too soon. Programming is an art and you can't expect to do it without understanding the tools used to do it. Firstly learn about variables, strings, arrays, expressions, operators and flow control constructs (more or less in that order) and then start to construct some simple scripts. The best way to learn from there is to code up some simple pages to do some basic things like constructing tables from arrays or printing out different messages depending on what day of the week it is. From there you can start looking at databases, objects and form handling. By this point you should be well away and things in your existing books will begin to make sense.

    As Buddy Bradley said if you have specific questions then you can post them here - people are very helpful and willing to solve problems.

  4. #4
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The Right Book

    Quote Originally Posted by Buddy Bradley View Post
    If you find you're not understanding the way a book is teaching something, you can only try a different book - all writers have different styles to impart knowledge, some will work for you and some won't.
    Truer words never spoken! I remember when I was trying to learn "C" years ago. Every time I opened the book I had, it was like hitting a brick wall. I finally found a book that worked for me.
    A good book that works is like a breath of fresh air and worth its weight in gold.

    I usually spend a lot of time on Amazon.com reading the book reviews before deciding which to go with.
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  5. #5
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Arrays are the first "hurdle" new programmers have. They're rather invaluable, and a lot of new programmers struggle to understand how they work and fully recognize their uses.

    As Buddy said, though, not everyone is made to be a programmer. That's not a knock -- people are just built differently. I'm sure not going to try and replumb my house, or fix my car. Or even pick out matching colors.

  6. #6
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks everyone

    I think tim912 hit it on the head. PHP takes time. I do feel I have the ability as I do digest some of the material.. At times I bite off a little more than I can chew in my haste to create my website. I think I am bit impatient. I will prevail (how's that for positive thinking?)! In the mean time, stay tuned for dumb question or two on this same channel! Thanks for the help and suggestions.


    DAD

  7. #7
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Location
    Lahore
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you must have fully what is php how it works, what is it for. what is the purpose of this language etc.

    Honesty resolve these question and free you mind from zigzag thinking about php...make it straight.. after this you i must recommend you to see example and see how they work.

    Books i think all php related books are very good. Thing is how is your concentration..

  8. #8
    SitePoint Member wal.Z's Avatar
    Join Date
    Apr 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I learned the basics from this tutorial, and just dived right into an open-source php app and didn't let go until I understood at least one section of how it worked.

    Indeed, its true that you should not expect to be pumping out code by the end of the day. It takes time and effort to understand something for the first time, and it isn't any different with php.

  9. #9
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by htmldad View Post
    Can anyone give me some suggestions?
    Keep at it, you wouldnt expect to learn French or German in a few weeks, and the same is true of PHP, C+, ASP ...........

    Each time you hit a problem and solve it you move forward and learn, stop being so hard on yourself and enjoy the learning process.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  10. #10
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suggest you taking some programming classes, not necessarily PHP but Java or C++
    Last edited by libranet; Apr 20, 2007 at 16:29.

  11. #11
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As a former IT teacher I saw this a LOT.

    MY first question would be: What other programming experience do you have?

    If you have the energy stick with it, maybe try a few different books or some of the great tutorials on the web BUT there are times when you just have to face the fact that you may not be cut out to be a programmer.

    No that's not being mean! I had to say that exact line to more students than I can count, it sucks to have to say it but more than not it's the truth.

    Not everyone is cut out to be a programmer or developer, just like not everyone has talent for design and graphic work. If anyone could do it there wouldn't be any such thing as a programmer!

    Programming takes a special kind of person. They are the ones that can't STAND to leave a puzzle half done. Warped is a good term for it and I count myself in that group. It takes a good ability to solve problems while looking at the big picture. It takes patience and persistence like you have never seen.

    Now if you are coming from another language other than PHP I sympathize completely. I did Java for 5 years before I switched to PHP and it was the worst experience of my life!

    So don't just quit, try other avenues to learn what you want to learn. Maybe (if you haven't programmed before) take some basic programming theory courses... but also be aware your talents may be better used in something else.

  12. #12
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP was not my first language. I started with AppleScript, which really taught me the basic concepts of programming (loops, conditionals, variables, etc.) Then I dabbled in C a bit. I never really learned the language, but I gained a much better knowledge of programming.

    I started learning PHP with it's own manual. http://www.php.net/manual/en/language.basic-syntax.php is where I started. I've never read a single book on it. For anything I can't do I look on SitePoint or Google and I find out about it.

    So, my point:

    a) perhaps start with a simpler language
    b) start PHP by reading the manual (not the whole function reference but the first section (Laguage Reference)).

  13. #13
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks again

    Thanks everyone for your time and comments. I did'nt start this project with the intent to give up. I will press on. Eventually my goal of having a correctly configured website will become a reality. Already I have emmulated my laptop as a server. I am also quite comfortable with HTML (thanks to Sitepoint). I'm halfway there. No sense in giving up now.
    Thanks again everyone for the help!

    DAD

  14. #14
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then we need your exact problems. Give us your errors, post your code, and we'll help you.

  15. #15
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A bit at a time

    It sounds like your trying to understand everything all in one go. I would start with variables and if statements. Just start writing it and you will pick it up. Dont read as much until you actually start doing it it wont be clear.

  16. #16
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I learned the basics of PHP from http://www.w3schools.com/php/. I then looked at simple scripts and slightly edited them. I can't remember what I've done after that, truthfully. A good PHP tutorial (which unfortunately I didn't use during my beginning stages) is http://hudzilla.org/phpwiki/. It's a great online tutorial that will teach even advanced programmers a thing or two.

    I find no need of buying programming books unless you just are a book person.

  17. #17
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks again

    Thanks again for all of the replies (15 is a record for me). Nice to know there is help out there! Great board Sitepoint!


    DAD


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •