User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 21 Jan 2004, 00:30   #1
__cLowN_pAiNt__
Registered User
 
Join Date: Dec 2003
Posts: 5
__cLowN_pAiNt__ is an unknown quantity at this point
Learning PHP and MySQL

*n00b alert*
At the moment im reading a book on XHTML, when i finish that I'm going to learn PHP and MySQL to help me to create better websites, ive got a book on it and i thought it would make life alot easier but it hasnt with MySQL, but how difficult is it to learn, i cant figure out MySQL and how it works properly (admittedly i havent tried properly yet) but does it have its own language to tell it to do stuff or something?

Also i tried to learn PHP/MySQL a while back and just got completely baffled when they wanted me to set up a database and server to test my pages offline, it was so confusing.

If someone could just shed a little light on MySQL, what it is all about, and how to work it, it would be well appreciated.
__cLowN_pAiNt__ is offline   Reply With Quote
Unread 21 Jan 2004, 01:33   #2
SYMM
Love's Sweet Exile
 
SYMM's Avatar
 
Join Date: May 2001
Location: Living on a Stair (Now Sword-less)
Posts: 2,371
SYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better placeSYMM single handedly makes these forums a better place
Re: Learning PHP and MySQL

SQL is Structured Query Language, that is a way of telling a database to do stuff.
That can be adding new data, updating data, creating the "tables" the data is stored in, or simply selecting a certain set of data to be displayed.
MySQL is a variant of the SQL family, and is widely used because it is free, and because it can be used nicely with PHP (i'm sure there are other reasons too...).
MySQL is run on the command line, by typing "mysql" once it is installed (there will be instructions on how to do this on a website somewhere, but its a case of following instructions), and then once it loads you can do all the fancy stuff.
A book on any sort of SQL will be able to help you get started, as the basic calls tend to be the same.

Using MySQL with PHP, is a case of connecting to the database, putting together the SQL query, and then querying the database (and by "query", this can be anything from a SELECT which will return a set, to creating or deleting tables).

Get a book from a library or somewhere and get everything installed(PHP,Apache,MySQL) and then get started
__________________
--SYMM--
Ba Ba Ti Ki Di Do
SYMM is offline   Reply With Quote
Unread 21 Jan 2004, 23:13   #3
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
Re: Learning PHP and MySQL

SQL is actually 2 distinct languages, DDL and DML. Data Definition Language just tells the database how you would like the tuples in the db stored. The Data Manipulation Language specifies how you retrieve, store and update tuples.

And they are both VERY VERY straightforward.
__________________
#linux : Home of Genius

<idimmu> ok i was chained to a desk with this oriental dude
MT is offline   Reply With Quote
Unread 22 Jan 2004, 01:26   #4
meglamaniac
Born Sinful
 
meglamaniac's Avatar
 
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.meglamaniac has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Learning PHP and MySQL

Also, if you have any difficulties MySQL-wise there are extremely professional (and free!) MySQL database management tools available. PHPMyAdmin is a very good example of this (don't be confused by the PHP part of the name, that's just cos it's written in PHP).
Why do I mention this?

Such tools have backup facilities. They can backup to various formats, including MySQL statements. Better yet, you can output the SQL that defines the table, the SQL that inserts the data into the table, or both.
So, by using the table creation and data editing facilities in the tool and then "backing up" the table, you get a custom made example of how to write SQL statements.

For lazy people like me, PHPMyAdmin is also handy for:
* Creating and editing new tables
* Entering, editing or deleting data in tables (generally when one of my PHP scripts has buggered up and filled it full of crap)
* Testing SQL statements before I put them in scripts (you can run any SQL statement you like on any of your tables from the tool)
* Just having a nice clean overview of all my tables and data without having to mess about writing the tool to do it

It's especially handy if, like me, your database and files are on a remote webserver.

__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
meglamaniac is offline   Reply With Quote
Unread 22 Jan 2004, 16:45   #5
Raging.Retard
Street Tramp
 
Raging.Retard's Avatar
 
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
Raging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant futureRaging.Retard has a brilliant future
Re: Learning PHP and MySQL

Quote:
Originally Posted by MT
SQL is actually 2 distinct languages, DDL and DML...
If we are going to be picky, its actually 3. You have forgotten to include the DCL. The data control language includes general maintenance crap (which is normally DB specific), but more importantly transaction control (BEGIN TRANSACTION .... COMMIT etc).
__________________
Chimney Pots.
Raging.Retard is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 13:44.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018