MySQL

Learning MySQL/*First what needs to be done is to create a database for users to store the table; in order to do this enter*/CREATE DATABASE (database name);/*example CREATE DATABASE members;*//*next is to create a table within the database, to do this select the database you wish to use, for example ‘members’ typing ‘USE members’ into MySQL. Then type*/CREATE TABLE `members` /*to create a table called MEMBERS*/(
`id` int(4) NOT NULL auto_increment, /*sets up the classification and

`username` varchar(65) NOT NULL default ”, /*setting up the username variable and allowing a maximum of 65 characters*/

`password` varchar(65) NOT NULL default ”, /*setting up the password variable and allowing a maximum of 65 characters*/

PRIMARY KEY (`id`) /*ordering of the table by listing them in the order they sign up for the website, in this case by ID NUMBER*/
) TYPE=MyISAM AUTO_INCREMENT=2 ; /*not to sure what this does however in my case the coding didn’t work*/

— Dumping data for table `members`
INSERT INTO `members` VALUES (1, ‘john’, ‘1234’); /*this is setting up the user data into the table*/ ALTERNATIVE CODING THAT DOES WORK FOR MYSELFCREATE DATABASE members;USE members;CREATE TABLE tblUsers(
UserID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
/*alternative to PRIMARY KEY(id) as labelled above*/
UserName VARCHAR(65),
UserPassword VARCHAR(25),
UserEmail VARCHAR(255));
All MySQL Coding is like actionscript in the sense that it is in between the (   ) brackets instead of {  } that actionscript usesINSERT INTO tblUsers (UserName, UserPassword, UserEmail) VALUES(‘Marc’,’1234’,’marctaylor6631@googlemail.com’);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: