Even wonder how to set mix of two or more MySQL database columns/fields as primary key in phpMyAdmin as there is no direct link during creation of table. This articles with tell you the way to setting composite primary key in phpMyAdmin.
Tag » Database
convert time string into time with AM/PM in MySQL
I have the old database in which time was stored as string with AM/PM. One day I required to do some time calculation on that field. I have googled out for convert time string into time with AM/PM in MySQL and found some solution.
How to concate column values in group rows in mysql
Sometime we face the problems for concatenating of group rows column value in a single string. Group_concat() is a function which help us to achieve this.
Apply foreign key in phpMyAdmin using database query
If you already have database tables and you just want to apply foreign keys for record on those table then you can apply foreign key in phpMyAdmin using database query also.
I have already written a tutorial ‘Setting up foreign key in phpMyAdmin‘ with example images and I prefer to write database query to set up foreign key in existing database tables as queries allow me to accomplish all required steps in once go.
Comma separated values or delimited list in database – the Bad the Good
Saving comma separated values or delimited list in database looks convenient at first but never use them because most and most of the time that’s only a bad idea. I have provided many reasons to avoid them and only one when you can take favour of.
Delete or remove duplicate rows in MySQL
You can easily remove duplicate rows in MySQL and keep just one record for each. I have provided two solutions here, one is simple query and second is using subquery to attain the same
Setting up Foreign Key in phpMyAdmin
Setting up foreign key in phpMyAdmin is quite easy. With help of this step by step pictured tutorial, you will be able to set foreign keys within your tables.
Here in the example we have three tables. ‘products’, ‘category’ and ‘product_category’. You can see structures of these tables in the picture below:
Syntax error due to using a reserved word as a table or column name
If we try to execute a simple MySQL query or any database query that contains reserved word as a table or column name we come across syntax errors.
We have discuss two options to have Defense from syntax error using a reserved word as a table or column name.