|
|
|
|
Create MySql database with phpMyAdmin
We will learn basic usage of phpMyAdmin, one of the most popular applications for editing MySql databases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2.
|
|
|
First we will create new database.
Into the field under Create new database enter my_db, which will be the name of our database.
Click button Create.
|
|
|
3.
|
|
|
Now we will create a new table.
Enter my_table into the Create new table on database field. For Number of fields enter number 4.
Click button Go to create a new table.
It is important to understand that databases usually have more than one table. If you like, you can later add additional tables.
|
|
|
4.
|
|
|
For names and types of fields we set the following values: id (INT) number (INT) text (TEXT) date (DATE)
Name of field can be arbitrary. Type for each filed defines what kind of content the field will contain.
Type INT represents whole numbers. Type TEXT represents text. Type DATE will accept date format.
|
|
|
5.
|
|
|
We named the first filed id and it will represent a number that is unique for every record.
This is usually need if we want to delete or edit specific record.
We click A_I (Auto_Increment) checkbox.
When we insert value 0 for this filed, MySql will automatically assign a value that is an increment of the current highest number in the table.
|
|
|
6.
|
|
|
Now we will insert some data into our table.
Click tab Insert.
|
|
|
7.
|
|
|
Enter the following values:
field id: 0 field number: 123 field text: sample text field date: 2013-05-03
Date filed must be in format year-month-day.
Click button Go.
|
|
|
8.
|
|
|
By clicking the tab Browse, the content of our table will be shown.
|
|
|
9.
|
|
|
If everything was done correctly, you should be able to see the data that you entered.
By repeating the steps above you can now insert new data or you can try to create additional tables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I am glad you like it. If you have any additional questions, please do not hesitate to ask. |
|
|
|
|
|
|
|
|
Hello, I was a bit lost on the first step. as I did not see any option to create a new database. the PHPMyAdmin version I am using is Version information: 3.5.5,
I did somehow manage to create the database in Cpanel database wizard. and the followed all your steps. I appreciate your help as you made it so simple to understand, which otherwise would be confusing.
I would now like to learn how to connect a php form with the db I created. can you help. |
|
|
|
|
|
|
|
|
Your service provider most probably does not allow to create database through phpMyAdmin and only allows databases to be created in cPanel. They do this to have more control.
Anyway I am glad that you managed to create the database.
About connecting a php form with connection to the database, I can prepare a lesson about this today and it will be published tomorrow. As you will see it is not that complicated.
And of course if you have any additional question about PHP, just ask here on forum and I will do my best to help you.
|
|
|
|
|
|
|
|
|
I'm so happy to know that there are generous people like you who go out of the way to help. it may be a simple thing for you, but its a great help for people like us. Appreciate everything you did for me so far. I will post any question I have in the future in the forums. thanks a lot. |
|
|
|
|
|
|
mat,
24th May 2013, 1:56 AM |
|
|
Thanks Gavin for the kind words. That's why is the idea of knowledge sharing so great, some people are great at php, some at Photoshop others know how to build a chair, etc. We can all learn and gain from eachother, that's the whole point. Enjoy your stay! |
|
|
|
|
|
|
|
|
Hello, When I first started out, I was confused. as I could not find a way to initiate a brand new database. My current installation of PHPMyAdmin is 3.5.5 (see below for version details).
Cpanel's database wizard helped me set up the database. and they did exactly what you said to do. Thank you for clarifying something that, without your assistance, I would have found difficult to grasp. https://phrazle.co |
|
|
|
|
|
|
|
|
With over 250 college teams to choose from, https://retrobowlcollege.org presents you with a vast array of options, each with its unique set of challenges and opportunities for success. |
|
|
|
|