Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 03-29-2005, 11:35 PM   #1
Cap Ologist
College Prospect
 
Join Date: Nov 2003
Location: Flower Mound, TX
My PHP Learning Experience

A couple of weeks ago I discovered an online gangster game. After spending some time playing this game I realized that I was becoming intrigued with the php language. I went to Half Price Books and looked through some resources there and then Barnes and Noble.

A couple of months ago, I started another programming dynasty that died. Hopefully, I'll have better success with this.

I'm working through a book called "Sam's Teach Yourself PHP, mySQL and Apache". I've used books from Sam's Teach Yourself series in the past, and have found that they explain things in a way that I can grasp.

The first couple of chapters deal with setting up a programming environment on your computer/server. I'm not going to bore you with too many of those details.

Chapter 5 is where I'm going to pick up. This chapter si called "The Building Blocks of PHP". It deals mainly with variables and data types. I read through it pretty quickly, alot of it was familiar with a few changes that I picked up pretty quickly. One thing I like about PHP already is how it handles variables. In other languages that I have experience with like Java and Visual Basic, you have to declare what kind of data type the variable you are using is. For example, in Visual Basic, I would write Dim nNumber As Integer. In PHP however, variables are prefaced with a $ and the language figures out what data type should be used. I'm going to use a naming convention I've used in the past with my variables so that I can easily identify what's going on. I'm going to add the lowercase first letter of the data type immediately after the $, so if I was planning on the variable referring to a string, it would be known as $sName.

Chapter 6 is about Flow Control Functions such as if-thens, loops, and switches. This is a chapter I paid a little more attention to because there are some technical nuances that are different from Visual Basic, which is the language I have been working with most recently. Most of this was still pretty straightforward.

Chapter 7 deals with functions which are used in programs to pass information to different parts. This was one of the hardest things for me to understand several months ago, but having been exposed to Java and Visual Basic, it was pretty easy for me to see what was going on here.

Here is a sample PHP program that I've written. It will tell you the final score of all 39 Super Bowls. I wrote to practice some of these things that I've been learning (declaring variables, a switch loop, and passing of data) while using somethings (forms) that I've mainly skimmed over. Forms are still a chapter or two away. So go ahead, and check out my Super Bowl program.

That's what I've gone over the last two days. My plan is to work through at least one chapter a week. Right now, most of the material is somewhat familiar, but I'm anticipating some difficulty especially when I get into work with databases. I haven't messed with databases in any form since my sophomore year of college about 7 years ago.

Cap Ologist is offline   Reply With Quote
Old 03-30-2005, 12:02 AM   #2
sabotai
General Manager
 
Join Date: Oct 2000
Location: The Satellite of Love
Just to give you some alternative reading sources in case you want to have multiple sources (always a wise choice), here are the PHP (and related) books that I have that I recommend.

Web Database Applications With PHP and MySQL by Williams and Lane (O'Reilly book)
Programming PHP by Lerdorf and Tatroe (O'Reilly book)
PHP Cookbook by Sklar and Trachtenberg (O'Reilly book)
PHP And MySQL Web Developement by Welling and Thomson (not an O'Reilly book )

Of course, I'm not saying go out and buy all of these, but they're worth looking through at the bookstore and if you want 1 or 2 more sources.

Good luck with this. I'll be following.
sabotai is offline   Reply With Quote
Old 03-30-2005, 12:15 AM   #3
Cap Ologist
College Prospect
 
Join Date: Nov 2003
Location: Flower Mound, TX
Thanks, I'll keep my eye out for those. If Barnes and Noble have them, I'll probably spend some time there looking through them.
Cap Ologist is offline   Reply With Quote
Old 03-30-2005, 02:54 AM   #4
Alf
Pro Starter
 
Join Date: Jan 2001
Location: Rennes, France
Welcome to the bright side CapOlogist ! (Edit , check my sig, the Francestats-ht link goes to a web based php+mysql stats site I have built using primarily www.php.net and www.mysql.com + a few advice from online guys)
__________________
FOFL - GML - IHOF - FranceStats

Last edited by Alf : 03-30-2005 at 02:56 AM.
Alf is offline   Reply With Quote
Old 04-03-2005, 06:33 PM   #5
Cap Ologist
College Prospect
 
Join Date: Nov 2003
Location: Flower Mound, TX
Let's see, this past chapter was on arrays and objects. Arrays are very simple, they are very similar to what I've been exposed to in the past. Objects have always been somewhat confusing to me, but I think I began to see through the fog as I was going through the chapter. I'll probably spend some more time on objects in the next couple of weeks.

One question I have about associative arrays. Is it possible to step through them with loops? Meaning, I have an array of "name", "age", and "college". Can I set a loop to go through them as array(0), array(1), etc. or does the language no longer recognize the index values? I hope that makes sense enough for someone to explain it to me.

If anybody knows a good website or other resource about object oriented programming, I'd appreciate the info. I really want to make sure I understand all the ins and outs of OOP.
Cap Ologist is offline   Reply With Quote
Old 04-03-2005, 09:28 PM   #6
Dutch
"Dutch"
 
Join Date: Oct 2000
Location: Tampa, FL
I am getting in to PERL and PHP looks very similar, as I suspected. Cool! I'll be following along.
Dutch is offline   Reply With Quote
Old 04-05-2005, 03:17 AM   #7
Alf
Pro Starter
 
Join Date: Jan 2001
Location: Rennes, France
Cap, there is the function : foreach for what you want to do. A must with arrays if you want to do anything.

http://fr.php.net/manual/en/control-...es.foreach.php

Dutch : PHP is Perl for noobs (just like me, and I like it)
__________________
FOFL - GML - IHOF - FranceStats
Alf is offline   Reply With Quote
Old 04-05-2005, 11:51 AM   #8
Dutch
"Dutch"
 
Join Date: Oct 2000
Location: Tampa, FL
Isn't PERL easier than PHP?
Dutch is offline   Reply With Quote
Old 04-06-2005, 02:27 AM   #9
Alf
Pro Starter
 
Join Date: Jan 2001
Location: Rennes, France
Quote:
Originally Posted by Dutch
Isn't PERL easier than PHP?
For my personal experience, I would say no, but I am no programmer, and I use PHP combined with MySQL to build a stats site (check my FranceStats linky). And it is efficient enough and clear enough.
__________________
FOFL - GML - IHOF - FranceStats
Alf is offline   Reply With Quote
Old 04-13-2005, 12:48 AM   #10
bw1488
n00b
 
Join Date: Apr 2004
Wow,Deja Vu.I myself found an online gangster game(omerta) and like it alot,but I thought to myself there is so much more they could do with it.So i got a hold of a friend of mine and he sent me the source code for an MMORPG that he used to build a game that is inplay at this moment,and I said to myself.I'm gonna learn this php stuff and make some changes and adjustments to make this D&D type game into a gangster game the way I think it should be,this was 4 days ago.If you like I could send you the source code for the game so you can see what its like.I don't have a clue about programming myself,but I have been looking for some stuff to help me learn it and boom here you are and you've given me the advice I need on where to go for the help.
bw1488 is offline   Reply With Quote
Old 04-13-2005, 10:12 AM   #11
primelord
Pro Rookie
 
Join Date: Oct 2000
Quote:
Originally Posted by Dutch
Isn't PERL easier than PHP?

Dutch,

They are actually very similar. I also wouldn't say either is really harder than the other. FWIW I am pretty good with Perl. If you have any questions along the way I would be happy to help.
primelord is offline   Reply With Quote
Old 04-15-2005, 10:23 PM   #12
Dutch
"Dutch"
 
Join Date: Oct 2000
Location: Tampa, FL
Thanks Primelord, it's appreciated. I may not have any questions for a while. I'm just getting into it and the tutorials I have are fairly easy to follow so far (http://learn.perl.org/library/beginning_perl/). I know it will get a bit tougher later on.
Dutch is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 08:00 AM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.