Getting started in PHP & MySQL Databases?

AgaBoogaBoo

Lifer
Feb 16, 2003
26,108
5
81
I need to slowly start learning PHP and using it in conjunction with MySQL. I've taken 2 years of the Computer Science AP Java classes and spent a lot of that learning OOP. I have experience with HTML, basic javascript, editing some Perl scripts years ago, etc. etc.

Anyway, I'm looking for some kind of guide to help me start coding my own PHP scripts and then I'd like to learn how to use MySQL databases with PHP. I have a project or two in mind specifically, which is why I need to learn this.

Thanks :)

Edit: Books are fine too, whatever will be best at teaching me what I need to know to be able to use inforration from MySQL databases and process it using PHP.
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
php manual...all you need...plenty of examples
I recommend getting the chm (windows help style) file off php.net...amkes it all organized and indexable and searchable and if u do get the one with examples it is about the best help manual out there i've ever seen
 

Zugzwang152

Lifer
Oct 30, 2001
12,134
1
0
are you already familiar with SQL syntax and just need to learn the PHP interface to mysql, or will you need to learn both?
 

AgaBoogaBoo

Lifer
Feb 16, 2003
26,108
5
81
Originally posted by: Zugzwang152
are you already familiar with SQL syntax and just need to learn the PHP interface to mysql, or will you need to learn both?

need to learn both
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Originally posted by: Drakkon
php manual...all you need...plenty of examples
I recommend getting the chm (windows help style) file off php.net...amkes it all organized and indexable and searchable and if u do get the one with examples it is about the best help manual out there i've ever seen

:thumbsup:
 

Carl Uman

Diamond Member
Jan 29, 2000
6,008
2
81
I would recommend learning them sepearte first then combine the two. Maybe get a query tool that lets you run queries on the MySQL DBs so you can learn that. Then after you get that down you can move on to PHP and running the code you wrote. BTW use stored procedures and not inline SQL statements in you PHP (I think MySQL supports stored procedures now... didn't use to). I'm working on PostgreSQL myself then onto PHP. I already do ColfFusion/MSSQL.

Have fun :D
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Originally posted by: Carl Uman
I would recommend learning them sepearte first then combine the two. Maybe get a query tool that lets you run queries on the MySQL DBs so you can learn that. Then after you get that down you can move on to PHP and running the code you wrote. BTW use stored procedures and not inline SQL statements in you PHP (I think MySQL supports stored procedures now... didn't use to). I'm working on PostgreSQL myself then onto PHP. I already do ColfFusion/MSSQL.

Have fun :D

PHPMyAdmin is a good tool for running/testing queries in MySQL. Personally, I think it takes more time and effort to get really good at SQL than PHP. I learned PHP in a day while working on a project. For complex SQL queries, I find it's useful to use a diagram of the database to visualize the query.

PostgreSQL is a more "industrial strength" DB than MySQL, but I think MySQL is more widely supported by web hosts. So for practical purposes, MySQL may be a better choice.

I'd recommend getting a good book on database theory and SQL, don't waste money on a PHP book. You could probably get a good used older edition textbook pretty cheap.
 

GeekDrew

Diamond Member
Jun 7, 2000
9,099
19
81
It all depends on the speed in which you need to learn how to write in PHP & MySQL as to how you learn it. ;)

My background: I programmed in GWBasic & QBasic several times, when I was much younger.

A company I work with needed a registration portal online as of this past February 1st... and I was the only person that came close to having the time and skill to do it. The problem? I had never written in any web coding language before (PHP, ASP, etc), nor had ever interfaced with an online database (though had Access down to an art, which was completely irrelevant), and had used HTML quite a bit, but it had been years since I had used it.

On January 27th or so, I drove up to Barnes & Noble, and picked up Larry Ullman's PHP and MySQL for Dynamic Web Sites (ISBN 0-321-18648-6). I read it cover to cover (within a few hours), and then sat down at my PC, and got to work. The book came with a few example projects that you could reference, if you really need to, but I doubt you'd need to - you'll pick it up very easily, I'm sure. BTW, I had the website online by the deadline - we came online around 4PM on February 1. ;)

Yes, PHP includes object-oriented programming, but I'm just now (yes, now, after developing a very extensive and surprisingly trouble-free website) starting to grasp the concept of object-oriented programming, as I've never had a programming class in my life, have never even touched Java, C++ or any other "true" programming language, and the book I used to read about PHP initially does not cover object-oriented programming - it's a more basic approach. Implementing OOP doesn't seem very hard to me, though, just from what I've seen so far (which is admittedly little :( ).

Good luck!
 

BurnItDwn

Lifer
Oct 10, 1999
26,342
1,855
126
I wrote my webpage in PHP to interface with PostgreSQL. If you know html and perl, PHP will probably be VERY easy for you to pick up.

I used documentation on http://www.php.net/ to learn.