Friday, March 21, 2014

mysql_fetch_row() vs mysql_fetch_assoc() vs mysql_fetch_array()

What will the different functions return?

All of the mentioned functions will return an array, the differences between them is what values that are being used as keys in the returned object.
  • This function will return a row where the values will come in the order as they are defined in the SQL query, and the keys will span from 0 to one less than the number of columns selected.
  • This function will return a row as an associative array where the column names will be the keys storing corresponding value.
  • This function will actually return an array with both the contents of mysql_fetch_rowand mysql_fetch_assoc merged into one. It will both have numeric and string keys which will let you access your data in whatever way you'd find easiest.
    It is recommended to use either _assoc or _row though.

Thursday, March 20, 2014

What is difference between MYISAM and InnoDB?

The major thing that beginners are curioues to know what are the difference between InnoDB and MyISAM. Below is difference between MYISAM and INNODB hope this will help you out a lot. 

MYISAM:
1. MYISAM supports Table-level Locking
2. MyISAM designed for need of speed
3. MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS
4. MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)
5. MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done. 

INNODB:
1. InnoDB supports Row-level Locking
2. InnoDB designed for maximum performance when processing high volume of data
3. InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS
4. InnoDB stores its tables and indexes in a tablespace
5. InnoDB supports transaction. You can commit and rollback with InnoDB


Difference show By below table.

My ISAMInnoDB
Required full text SearchYes
Require TransactionsYes
frequent select queriesYes
frequent insert,update,deleteYes
Row Locking (multi processing on single table)Yes
Relational base designYes

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...