Category: MYSQL

php-articles

PHP – Convert from MySQL datetime to another format with PHP

Date is important aspect in developing applications such as storing user registration date time ,last login time, date of birth etc. Mysql has standard format that is YYYY-mm-dd and but we want that to be in regional or in some other format. using strtotime and date function printing only date using strtotime and date function […]

MYSQL Articles, Errors and Fixes

MYSQL- What are the main differences between InnoDB and MyISAM

InnoDB InnoDB is a storage engine for MySQL. MySQL 5.5 and later use it by default.  It provides the standard ACID-compliant transaction features, along with foreign key support (Declarative Referential Integrity). It is included as standard in most binaries distributed by MySQL AB, the exception being some OEM versions. InnoDB became a product of Oracle Corporation after its acquisition of Innobase Oy in October 2005.  The software is dual licensed; it is distributed under […]

MYSQL Articles, Errors and Fixes

SQL – How to ‘insert if not exists’ in MySQL

How to write INSERT IF NOT EXISTS queries in standard SQL If necessary, INSERT IF NOT EXISTS queries can be written in a single atomic statement, eliminating the need for a transaction, and without violating standards. In this article we explained several ways to write such queries in a platform-independent way. Several solutions: One solution […]

Tamp Table and table variable

SQL- What’s the difference between a temp table and table variable in SQL Server

Temporary Tables Temporary Tables are a great feature that lets you store and process intermediate results by using the same selection, update, and join capabilities that you can use with typical SQL Server tables. The temporary tables could be very useful in some cases to keep temporary data. Types There are mainly two types of Temporary Tables-Local & Global Temporary Tables. […]

MYSQL Articles, Errors and Fixes

[Solved-9 Answers] Which MySQL Datatype should be used for storing boolean values?

PROBLEM Since MySQL doesn’t seem to have any ‘boolean’ datatype, which datatype do we ‘abuse’ for storing true/false information in MySQL? Especially in the context of writing and reading from/to a PHP-Script. The several approaches are : tinyint, varchar fields containing the values 0/1, varchar fields containing the strings ‘0’/’1′ or ‘true’/’false’ And finally enum […]