6 Replies - 598 Views - Last Post: 11 April 2012 - 01:11 AM Rate Topic: -----

#1 cxn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 10-March 12

How to code php/mysql

Posted 10 April 2012 - 01:41 PM

Hi guys,

I'm currently really hooked on learning PHP/MyQSL. I've been reading a bit of tutorials/beginner guids for the past two years really occasionally, only now really eager to learn. I noticed from the past that you really need to write some code in order to get the hang of it. That's the reason why I'm 'building' a small browser based game. The ideas are there and the coding is going fine for someone with my experience.
However.. lots of tutorials I read or answers to questions contain code like prepared statements with mysqli, a step further (if I'm getting this right?) is PDO. When I built my login and register page I used PDO, while not fully understanding mysql/prepared statements yet. I'm not sure whether I'm doing everything OK but it works, so that's a start. I want to use the latest techniques of PHP coding because the reason why I'm doing this project is because I want to improve, and stay up-to-date :-)
Another thing is OOP, using objects, classes.. This is a way of coding I have never seen before and is hard for me to grasp. I prefer using functions since it's easy to use.. Especially with the kind of project I'm working on; a browser PvP game.

So the question I have is: What do you suggest me to use, PDO and Oject Oriented Programming? If so, where can I find the best beginner help on OOP? Since this is something I have a hard time on.
Or still functions and maybe not even PDO but only prepared statements?

Thanks for the read :-)

Is This A Good Question/Topic? 0
  • +

Replies To: How to code php/mysql

#2 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: How to code php/mysql

Posted 10 April 2012 - 01:54 PM

Hey, I'm glad to see someone to that interested in php!
As for starting with a php based game...I'm not sure if it is the best but, if you are really interested, I'm not the one who's going to crash your dreams...Hope you can create a interesting game, and learn with it!
For answer your question, we have a really nice TUTORIAL here in DIC, featuring Dormilich, if you continue to post here( php forum) I'm sure you'll see him!

Hope you have a good time with mysql and php! Good Luck
Was This Post Helpful? 1
  • +
  • -

#3 cxn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 10-March 12

Re: How to code php/mysql

Posted 10 April 2012 - 02:03 PM

Hey, thanks for the fast reply!


Ah I remember that link, I've already seen Dormilich around and he linked me to it, but I was very busy back then. I'll certainly give it a read. Would you, however, recommend me to read a bit about OOP first?


Oh and just curious, what kind of project would you recommend a beginner such as I ? :)
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3030
  • View blog
  • Posts: 10,553
  • Joined: 08-August 08

Re: How to code php/mysql

Posted 10 April 2012 - 02:19 PM

OOP and PDO are two different subjects, although PDO can use OOP (and vice versa). You'll need to learn both.

I recommend you pick small projects and focus on writing well structured, readable code. You should also force yourself to make as your least important goal: "getting it to work". Quality code is easy to make work. Crappy code that works is still a nightmare.
Was This Post Helpful? 1
  • +
  • -

#5 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: How to code php/mysql

Posted 10 April 2012 - 02:28 PM

Well, I really don't know what you have tried ...but a read/write on the db.
a small dynamic website with a subject that you like!

like organizing your dvds/movies, or keep track of your music by style and something like that. and after that you can create something like statistics..like:

rock--> 300songs
pop--> 32songs

or for the movies

action-->32
thriller-->12
horror-->4




Think it would be a good start, but like I said, I really don't know where you at with the language!
Was This Post Helpful? 0
  • +
  • -

#6 Slice  Icon User is offline

  • sudo pacman -S moneyz


Reputation: 245
  • View blog
  • Posts: 719
  • Joined: 24-November 08

Re: How to code php/mysql

Posted 10 April 2012 - 03:16 PM

This site helped me grasp most of my current knowledge of OOP in php. It's a bit of a long read, having many chapters, but it covers wide aspects of php objects, in detail.

As for prepared statements, I must have read Dormilich's PDO tutorial about 1000 times. It has pretty much all you need to get on your feet with PDO :)

This post has been edited by Slice: 10 April 2012 - 03:18 PM

Was This Post Helpful? 1
  • +
  • -

#7 cxn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 33
  • Joined: 10-March 12

Re: How to code php/mysql

Posted 11 April 2012 - 01:11 AM

Thanks guys, think I have enough material to keep me busy for a few weeks haha!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1