SitePoint Sponsor

User Tag List

Results 1 to 24 of 24
  1. #1
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there any way of learning PHP that isn't so booooorrrring?

    variables, strings, foreach loops, mysql_real_escape_string...

    it's about as exciting as watching paint dry...
    Let everyday be Christmas

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    learn coldfusion instead

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2008
    Posts
    455
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Boring?
    The only thing I found boring was a sample of a lynda.com video and found it soo boring that I fell asleep

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I'd recommend head first PHP edition because they always make everything so fun. I thought PHP was boring to learn until you got into database stuff because that really is the bread and butter of the operation .
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  5. #5
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    If you don't like variables, loops or strings, I'm afraid programming is not for you, these aren't PHP specific.

    What exactly do you need for it to become 'exciting' ?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  6. #6
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've been learning PHP on and off since last September... the most complex item I've created so far are forms... I figure now is the time to up my game... I'm going to create blog for my portfolio... there's nothing like the satisfaction of successful creativity to make things more pleasant

    Okay, so I need to create a basic CRUD application.

    I figure starting off with my content and then work on any comment section afterwards.

    What about creating two tables - one for the category and the other for the content?

    Would these be solid tables in a database?

    Code:
    CREATE TABLE blog_Categories (
    id int(11) NOT NULL auto_increment,
    menu_name varchar(30) NOT NULL,
    date datetime NOT NULL,
    position int(3) NOT NULL,
    visible tinyint(1),
    PRIMARY KEY (id)
    );
    
    CREATE TABLE blog_content (
    id int(11) NOT NULL auto_increment,
    subject_id int(11) NOT NULL,
    menu_name varchar(30) NOT NULL,
    date datetime NOT NULL,
    position int(3) NOT NULL,
    content longtext NOT NULL,
    visible tinyint(1),
    PRIMARY KEY (id)
    );
    Let everyday be Christmas

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    semi-solid

    use something other than a reserved word for your `date` column

    why is menu_name in both tables?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  8. #8
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    I personally found PHP boring and the logic just made me kill myself. This sounds like a programming in general.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  9. #9
    SitePoint Wizard
    Join Date
    Apr 2002
    Posts
    2,301
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Divisive Cotton View Post
    variables, strings, foreach loops, mysql_real_escape_string...

    it's about as exciting as watching paint dry...
    have a creative goal -- something you want to build -- an idea. preferably have a small creative idea. then when you see it working you get immense reward. have a goal beyond just learning it for its own sake.

  10. #10
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SilverBulletUK View Post
    If you don't like variables, loops or strings, I'm afraid programming is not for you, these aren't PHP specific.
    A pure functional programming language doesn't have them though (Okay perhaps strings).

    Like Johnyboy said; If you don't find the process exciting, perhaps the end goal could help? Try building something that you might find interesting. A game, for example.

  11. #11
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    semi-solid

    use something other than a reserved word for your `date` column

    why is menu_name in both tables?
    okay yeah gotta - i've used menu_name but it could just as well been title
    Let everyday be Christmas

  12. #12
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Divisive - r937 was referring to the date column, the clue was his use of backticks in his comment change it to date_posted or something.

    Also, you have inconsistent casing for your table names. When you deploy on linux table and column names are case sensitive so it's a bad idea to have blog_Categories and blog_content

  13. #13
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey everyone, I have a related question. I too am just now learning PHP and MySQL, but I am also learning Javscript at the same time. For some reason I am having an easier time with PHP than Javascript. Even though Javascript was supposed to be easier(as I have been told atleast). I have the sitepoint books on Javascript and PHP. One thing that I have noticed is that there is a lot of overlap between the languages.

    My question is, if someone becomes extremely well versed in PHP and MySQL do they still need Javascript? If so, what does Javascript do that PHP doesn't. Please understand this is coming from a complete to programming and I have no preference in which is the better language. Im just looking for little guidance in what I should be spending the bulk of my time studying.

    Any help would be appreciated. Thanks !!

  14. #14
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bozzie - you should start a new thread, but just quickly the BIG difference is that PHP is server side, and JS is client side. PHP can generate the page (and even images, PDF and any other text based document) that gets sent to the browser, but can not interact with it after that. Javascript runs inside the browser and can do things like validate forms before submitting back to the server, DOM manipulation (e.g hide/show element) and even Ajax (POST/GET data from the server and update a small portion of the page without a full page reload).
    The may have some conceptual similarities but PHP cannot do Javascripts job.

  15. #15
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make something nice eg. a dynamic menu system, that is get the a href out the database.

  16. #16
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the help Mike. I guess they both have their place and I will continue to study both of them on a daily basis.

  17. #17
    SitePoint Enthusiast the-webber's Avatar
    Join Date
    Mar 2009
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't think it's too wierd that php comes more easily to you, bozzio, than javascript, the language i most loathe for its inconsistent implementation in the various browsers out there.


    cranial-bore did a good job explaining the core difference between the languages.

  18. #18
    SitePoint Zealot
    Join Date
    Jul 2007
    Location
    SW Washington, USA
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is a good starter book for PHP and MySQL?

    My only actual programming experience dates back to the early 80s with Basic and Fortran IV. As far as databases go I played with Access in the early 90s.

  19. #19
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by the-webber View Post
    javascript, the language i most loathe for its inconsistent implementation in the various browsers out there.
    I think you're referring to the various implementations of the W3C's DOM API ( nothing to do with Javascript or E-262 ), which is very inconsistent. Core Javascript is pretty much very consistent and at least up until version 1.5 cross-browser which includes JScript.
    Cross browser css bugs

    Dan Schulz you will be missed

  20. #20
    SitePoint Enthusiast akstar's Avatar
    Join Date
    Feb 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php is fun and easy to learn

  21. #21
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Teaching yourself PHP isn't boring unless you yourself are boring. If you want to learn the language your going to have to read. If reading is boring then your just SOL UASWOAP. >.>
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!

  22. #22
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,029
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    I think you're referring to the various implementations of the W3C's DOM API ( nothing to do with Javascript or E-262 ), which is very inconsistent. Core Javascript is pretty much very consistent and at least up until version 1.5 cross-browser which includes JScript.
    I agree...

    Off Topic:


    Also coding on the server being a transaction to transaction process makes it typically easier to follow the logic compared to client side Javascript which can handle key strokes, mouse movements, changes in the window size or focus up to a fraction of a second and then respond to all of this input. I was stunned and amazed at the capabilities when I first began coding on the client and still am. If you really want excitement, program a game in Javascript


    Unfortunately or fortunately depending on how you look at it there were some fairly big changes to PHP variables from versions 4.2 and onward which pretty much rendered the older books useless so, the only current books I can recommend are SitePoint's PHP Anthology collection. I've got all 3 and recommend them.

    If you find it boring, you'll find any programming boring... PHP is only a tool, you have to learn how to use it and come up with the task.
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  23. #23
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by imaginethis View Post
    Teaching yourself PHP isn't boring
    Dealing with the language (PHP) can be frustrating and boring if you're used to other languages with richer syntax, more advanced features and better overall language rules ( Perl, Python, Haskell ).. especially if you're forced to due to the team you're in or a limitation of a server that the client's website is hosted on and such.
    Cross browser css bugs

    Dan Schulz you will be missed

  24. #24
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulScratch View Post
    Dealing with the language (PHP) can be frustrating and boring if you're used to other languages with richer syntax, more advanced features and better overall language rules ( Perl, Python, Haskell ).. especially if you're forced to due to the team you're in or a limitation of a server that the client's website is hosted on and such.
    First of all Haskell ew... stay away D:!! I would think though the lack of complexity would make it far more interesting especially for acquisition. I found PHP far more fun than C++ and Python. But still I've never found acquisition boring.
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!


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
  •