Confused In Phpmyadmin - Dont know what to do anymore

Pages: 1, 2
free web hosting

Read Latest Entries..: (Post #12) by jlhaslip on Mar 27 2007, 03:10 AM. (Line Breaks Removed)
blank is fine, yes.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion > CONTRIBUTE > Computers > Database

Confused In Phpmyadmin - Dont know what to do anymore

BooZker
I have a book, PHP and MySQL for Dummies, and i guess i am more then a dummy. It is my first time setting up my own database from scratch. In the book it says to set up the table, but it doesnt tell you what to use or anything. Just to set one up and explains what you put and where. Here is where i am:

I made a Database called "boozker_aah" (not going to say what aah stands for yet. Its for my new site)

Then i want to make a table for the users (right?) I called it "aah_users"

Here is where i get confused. I want to make a user system and each user should have this data connected to it:

id #(required right?)
first_name (I want it to be required)
last_name (I want it to be required)
email (I want it to be required)
Age (Not required)
Country (Not required)
Website (Not required)
Short Bio (Not required)

Am i supposed to just put that data in the table aah_users? If so what do i put in the other fields? I am SO confused on this.

Also it says if i want to know when and how often users sign in and out to make a table which, in my case, would be called aah_logins. What do i put in those fields?

Lastly, what about the MAIN part of the whole user system? The user name and password? What do i do with that? I want a form for them to fill out and it makes it automatically like most sites. Fill in the above data along with a user name and password and it makes you a user. I don't need the PHP for this yet. I just need to know what to do with the MySQL stuff in PHPMyAdmin for the above stuff. It covers what i need to do in the PHP, but i dont know what to do with the MYSQL I am really confused.

Thanks so much if anyone actually helps.

 

 

 


Reply

jlhaslip
Are you doing this on your own machine? or here at the Trap?

Aside from version differences of the softwares, there is a MAJOR difference in the procedures.

The Shared Hosting at the trap will not allow you to create a Database using phpadmin. You need to use the MySQL Admin in the Control Panel to create a Database on the trap and then use phpadmin to add tables, etc. And don't forget to add a User and GRANT privleges to the User.

However, you will be able to create a database on your own local machine using phpadmin and that is pretty simple to do.

Once you have the database created, select the database from the drop-down on the left hand side. This will now become the current database and it should report that there are no tables, then the right side will ask about adding a table. Enter the table-name, number of fields and then "go".

Phpadmin will then display a grid of input filelds to add the values for the various elements of the "rows". The book you are using should provide enough information to allow you to complete the entries, such as the field's 'name', 'type', 'length', null/not null, and index, etc. when you are finished, select 'save' and it should all be good.

There is a selection to "EXPORT" . This will produce a file containing all the code to create the same db and table via the SQL method, but that is another lesson.

Hope this helps you understand it a bit better.

 

 

 


Reply

BooZker
I am doing this on Trap.

In my books example it says it needs a Member Directory Database, named MemberDirectory, then a table named member. I did that. So now in those rows i put the information i talked about above (name, age, ect) in those fields? Also how do i make a unique member ID number? There are a lot of fields. What things to i put and turn on?

Reply

jlhaslip
Those fields will contain the information required to set up the database only. They do not contain the data, just the information which describes the data, and instructs the sql server how to store it, and what to expect for values, etc.

The first column will contain the name of the field, and then the type of data expected, and so on across the page. The field which is given the value "UNIQUE" must be ... well, unique... for the database and values can be automatically included when data is INSERT'ed.

Read some more of the book and you will catch on to what sort of information is expected.

Reply

BooZker
Thats the problem... they go into the PHP side of it next. I need to set up the database before i can move on and i am totally stuck on it. They are saying to put rows and columns when i can't and everything is simply rows in PHPMySQL. Is there anyway you could put those fields in and take a screen shot as an example using the fields i want such as the ID # and first_name last_name and age ect?

Reply

jlhaslip
Here ya go.

In phpadmin, select the database, then select the SQL tab and cut/paste the following CREATE command into the textarea:
CODE
CREATE TABLE `users` (
`id` SMALLINT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`first_name` VARCHAR( 16 ) NOT NULL ,
`last_name` VARCHAR( 16 ) NOT NULL ,
`email` VARCHAR( 32 ) NOT NULL ,
`age` SMALLINT( 2 ) NULL ,
`country` VARCHAR( 16 ) NULL ,
`web_site` VARCHAR( 32 ) NULL ,
`short_bio` LONGTEXT NULL ,
UNIQUE (
`id`
)
) ENGINE = MYISAM;

It should create a table as per your information.
The schema is fairly minimal. I would've used Date of Birth instead of age, for instance, but perhaps the book will take you on towards Data Base Optimisation and Codd's rules.

Also, this should be saved as a file type " .sql ". The same or similar format can be created via phpadmin by 'EXPORT'ing the DB schema. And then 'IMPORT' the command to re-create a data structure. Handy to keep the current db in this format in case something explodes on you.

Try it. smile.gif

Reply

truefusion
Boozker, do you have any popular PHP script installed on your Trap17 account (e.g. WordPress, SMF, etc), anything that uses MySQL to store data? If so, learn from those. Look at how those databases are set up in PHPMyAdmin. If you have your own server on your computer installed with MySQL, get the MySQL Tools from the MySQL site (i'd recommend using the Query Browser). Learn from all of these things. Also, doesn't PHPMyAdmin show you the queries that were used when navigating through it? You remind me of myself when i first took a look into all of this. laugh.gif So much too learn, and so much time to do it in! tongue.gif

Reply

BooZker
I got about 80% of that right biggrin.gif I messed up on the Collation and a couple of the types and 2 actions. Thanks so much. That taught me a lot. Now i can finally move on from page 52 laugh.gif I read 52 pages in one day and finally got stuck on that stupid page. Thanks.

I know there is so much to learn. When i signed up at trap almost a year ago (April) i barley knew HTML. Now i know all the XHTML rules, CSS 1-2, and learning XML all within a year. So I have been learning a lot. It just takes me sometime considering i didnt even know what PHP was 8 months ago. Then Paul on the forums showed me some PHP Includes! God how i love those!

Reply

jlhaslip
By the way, I guessed at most of those settings. smile.gif

Use phpadmin to modify them as you need to. Chances are, if the book is any good, they will require you to add/change the TABLE structures to adapt the scripts, etc as a learning tool. Mysql is quite adapable.

Good luck with it.

Here is a link you might learn good stuff from (although it might confuse you,too) :

Database Optimisation

Reply

BooZker
CODE
CREATE TABLE `aah_members` (
`loginName` VARCHAR( 20 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'login name',
`password` VARCHAR( 16 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'user password',
`createDate` DATE NOT NULL COMMENT 'user sign up date',
`lastName` VARCHAR( 50 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`firstName` VARCHAR( 40 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`email` VARCHAR( 50 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`country` VARCHAR( 50 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`age` CHAR( 2 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
PRIMARY KEY ( `loginName` )
) ENGINE = MYISAM;


Does this look right? I made another one from scratch as practice, but added login name sign up date and a password. Would those be right? I want all those to be required also.

I'll check out that link also.

Reply

Latest Entries

jlhaslip
blank is fine, yes.

Reply

BooZker
OK i will fix it. Should i just make that blank? Thats what the defaults were on my others such as phpBB.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2
Recent Queries:-
  1. phpadmin password - 264.06 hr back. (1)
  2. phpmyadmin set unique field - 384.88 hr back. (1)
Similar Topics

Keywords : phpmyadmin

  1. Importing Cvs Files In Phpmyadmin - (2)



Looking for confused, phpmyadmin

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for confused, phpmyadmin

*MORE FROM TRAP17.COM*
advertisement



Confused In Phpmyadmin - Dont know what to do anymore



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE