First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Jeffrey F. Hill | Website: http://www.snowvids.com

Let's Get Started - Part I - setting up the mySQL database and relevant SQL commands

You must have a mySQL server set up by your host or on your local machine.  I'll be using the most basic shell commands to set up the table. However their are GUI's out there to make this part easier.  Your host may already have one set up for you to use. Make sure to read all the documentation your host has available on using mySQL on their servers - some may be different.  But it should all basically be the same.

Once your database has been set up. Open up your shell account. In most cases you can use Telnet to get to your account.  From the telnet command prompt - type in mysql -p YourDatabaseName Then you will be prompted for a password. Type in your password.  You'll see some text appear after this, then the command prompt changes to read mysql> (then Type) use Database Name.  We will name the table saveMovie for this example. Then type in the following create table syntax exactly as it appears below:

You can then use the describe table command to see what the table looks like.

Here are a couple other mySQL commands you may find useful from the shell.

Change the Column Name:  mysql>alter table saveMovie change Name SomeotherName varchar(30);  (This just changes the name notice the syntax - after change enter the old Column Name followed directly after by the New column name and definition.  

Delete one of the Columns: mysql>alter table saveMovie drop Name; This just deletes the column that you had previously named "Name".  

Select and view everything in the Table: mysql>Select * from TableName;

Delete the whole table and start over: mysql>drop saveMovie;

Short List of Column types (not if the data that you have entered into one of these definitions is larger then the amount you specified in the table it will be cur off):

varchar (Number) - A variable text type - in my opinion the easiest and most flexible to use when first starting out. Maximum is 60 characters Long. 

char (number) - A fixed character type column.

int (number) - A fixed integer type column. Default is 14 if you leave it blank. 

text or blob - use either when you want to enter a large amount of text.  

» Level Advanced

Added: 2001-07-03
Rating: 8 Votes: 116
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.