How to add, edit and delete records
Adding a record
To add a record to your database such as a new table, open your browser and enter “Localhost/phpmyadmin” into the address bar and login. This will open a page like the one below. On the left hand side select your database “xtremecms” to display the table structure will be displayed on the left hand side of the screen.
Select your table that you want to add to; in this instance we will select the news table. This will display the fields that are related to the news table. At the top of the page click the insert tab.
Diagram 2
Once the insert tab is clicked a page will load like the diagram below indicating the fields to enter information. The news_id is the primary key field and will auto increment (count automatically each time there is an entry) so no entry is required there.
Enter your information as required and click “Go” at the bottom of the page.
Editing a record
To edit a record that is stored on your database, select the table from the menu of tables located on the left hand side of the screen. In this instance we will use the news table. This will bring up a screen like the one below.
Click the “Browse” tab at the top to open the table and all its contents as pictured below.
Select the record for editing by clicking the pen icon that corresponds with the record for editing.
Clicking this pen icon will open a page like this one below displaying the information that is stored and displayed on the website.
Here is where you will edit you record. Once the record is or has been edited you will click “Go” located at the bottom of the page. This edited record will automatically appear on the webpage.
Deleting a record
To delete a record from your database open “phpmyadmin” and select the table that needs the record deleting from it. For this instance we will use the news table again.
Click the “Browse” tab to open the table as pictured above.
Select the record and click the icon to delete the corresponding record. This action will delete the record and it will no longer appear on the website.
Query instructions
To complete a query using phpmyadmin, open your browser and enter the address”localhost/phpmyadmin” into the address bar and hit enter. Enter your username and password into the spaces provided and click go. This will open the phpmyadmin page located on your server as shown below. Please select your database from the drop down list/menu on the left as indicated in the diagram below.
Query Diagrams
This will display a new window containing all the relevant tables that correspond with this database. At the top there is a query tab, please select this tab
This will display a page much like the one below. To do a query by users age select the users table first from the left hand side (as indicated) then click update query
Once submitted you will be given a confirmation screen like the one below indicating where the query is from, how long it took and what it is showing.
Responding to error messages
Error messages may appear due to poor configuration of databases and tables as an example. If you were to add a table and received an error, it may be due to as follows;
When creating a table the first field is normally the _id field. This is or must be set as an integer (INT) from the drop down menu. Then a numeric value is assigned into the Length/Value field, usually set to 11 for user id. It is crucial that any id field also be set as unsigned in the attributes, auto-increment in the extra section and finally set as the primary key for the table. Once these are set then the other values may be set using the other options.
To download this complete tutorial complete with screen shots Click below
Word doc version PDF version |