Log in

View Full Version : When learning PHP & MySQL...



Dirt_Diver
01-11-2009, 04:49 AM
Okay so it's been asked a billion times before when people come to the site and want to know how or what the best way to learn PHP & MySQL. Many books have been mentioned and many sites that go along with them.

Well not people know who I am here yet but I have been working on a few PHP sites and slowly learning along the way. I can not write PHP yet but today I picked up a few books from the library and even bought a few from ebay. Hopefully I will pick up the basics pretty fast then get in to some more advanced things like helping people right some codes.

As a beginner and looking at a couple of books I notice that 99% of the time it usually mentions something about installing PHP and MySQL on your machine but here is my question...

Is it really neccesarry to install these programs to learn them? The reason I ask is fairly simple. My web host has mySQL and PHP installed on it and I host my sites through them (godaddy). So for learning, should I take the time to install the programs and build another site for learning from scratch or could I just practice and build my site at the same time without installing them and just do everything on my host site?

Another question is this, I see a lot of people come through here, (me including) looking for help from some very awesome people. Are the codes that you guys write pretty much the same basic thing with some added extras or are they all pretty much their own thing?

With that said I am very interested in learning php and mysql to become very helpful to others on this site.

If you took the time to read this thanks, I hope to get some good feedback from it.

Nile
01-11-2009, 05:12 AM
Well, I would not suggest buying another domain to test, I would just use your computer as a server using WAMP or XAMPP (search google). They come with Mysql(SQLite manager, phpmyadmin), PHP, Apeche). And that stuff..

When you ask for help and people tell you to replace something, such as:


$var = "arizona";
$state = $_POST['state'];
if($state == $var){
echo "You live in ".$var;
}

And you ask, how do I see if they don't live in arizona, someone will tell you to add:


else { echo "You don't live in".$var; }

Which is an addition to the code.
How ever, if you ask how to then redirect(if they don't live in arizona), and on the next page say thanks... Its differen't:


$var = "arizona";
$state = $_POST['state'];
if($state == $var){
echo "You live in ".$var;
} else {
header("Location: thanks.php");
}

The highlighted is an addition, and thanks.php would basically be an addition and its own thing - as it has no effect if the person does live in arizone... Kinda confusing b.c they're basically the same thing. :D

Twey
01-11-2009, 06:10 PM
If you want to upload your files to the site every time you update them, that's fine, so long as your setup doesn't make it too cumbersome (most systems support saving directly to FTP or SFTP, but Windows doesn't seem to; if you're stuck using Windows you might prefer to develop locally, although there are a few tools that implement FTP saving themselves). However, I wouldn't recommend developing your site at the same time, because it will end up a mess. A test site would be greatly preferable, whether local or remote. Setting it up yourself might give you something of a better idea of how it all works, too.