Codxplore.com

Latest news: New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!


Try DISABLE KEYS before SET FOREIGN_KEY_CHECKS=0; make sure to SET FOREIGN_KEY_CHECKS=1; after. [NOTE] It's not a good idea to set a foreign key constraint to 0, because if you do, your database would not ensure it is not violating referential integrity. This could lead to inaccurate, misleading, or incomplete data. You make a foreign key for a reason: because all the values in the child column shall be the same as a value in the parent column. If there are no foreign key constraints, a child row can have a value that is not in the parent row, which would lead to inaccurate data. For instance, let's say you have a website for students to login and every student must register for an account as a user. You have one table for user ids, with user id as a pri....

Views: 61


something like SELECT id, email, IF(actived = 1, 'enabled', 'disabled') AS account_status FROM users this allow you to make operations and show it as columns. EDIT: you can also use joins and show operaitons as columns: SELECT u.id, e.email, IF(c.id IS NULL, 'no selected', c.name) as country FROM users u LEFT JOIN countries c ON u.country_id = c.id See the http://stackoverflow.com/questions/455261/how-to-create-virtual-column-using-mysql-select for refference

Views: 1407

Subscribe Us


Follow Us