Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Sunday, 17 July 2016

List of database compatible with PHP



List of  database compatible with PHP w3workers
List of  database compatible with PHP

In dynamic websites database plays important role for storing, searching, modifying or extracting data.

various database magement systems available to help your website backend we will discuss some advanced and popular database which is fully compitable with php.

PHP is open source script so best combination with php is open source database like MySQL, MariaDB, PostgreSQL.


But other commercial database like oracle, MSSQL also supports PHP.



Short description of features which is supported by all database mention in list:


RDBMS

Relational database management system (RDBMS) is based on the relational model as introduced by E. F. Codd.
So any database management system(DBMS) based on relational model by E. F. Codd is supports standard RDBMS.

SQL compatibility: 

SQL is Structured Query Language standard for database queries.

Cache:

Most recently accessed data from database by application program stored in computer memory is called cache. 
cache is used to minimize the amount of physical disk I/O performed by the DBMS.

B-tree: 

database tables columns indexing method to provides fast access to data in searching.

Client/Server architecture:

client performed operations from PC,smartphone web browsers on server where database exist.

Cursor:

its like a pointer for certain rows selected by query and points each row to navigate.

Stored procedures: 

Stored procedure is advanced queries written with in database.

Triggers:

Automatically execute by server on certain operations like (insert,update,delete).

Unicode: 

supports various charsets like UTF8,UCS2. 

Foreign key constraints:

In relational database model foreign key (one or more columns) of a table refers to one and only existing primary key column into another table.

Transactions:

transaction means in database execute several operations in block and ensures that all operations completed successfully.

Administration tool: 

For administering database server like phpmyadmin.


Below is list of RDBMS which is compitable with php:


These all database engine supports features described above

Except SQlite.

because SQlite is RDBMS file system unlike other database in list.


MySQL:



MySQL the most popular open source database w3workers
MySQL the most popular open source database
MySQL still most popular database management system and first choice of beginners because easy tutorials, documentation and support available.

WebSite:

link: www.mysql.com

Documentation:

link: dev.mysql.com/doc

Licence:

Open Source

Administration tool: 

phpmyadmin

MariaDB:



MariaDB open source and faster alternative for MySQL

MariaDB is open source RDBMS faster than MySQL 

MariaDB is replacing MySQL database because supports mysqli driver so you can switch from MySQL to MariaDB anytime without any modification in your MySQL queries.

WebSite:

link: mariadb.org

Documentation:

link: mariadb.com/kb/en/mariadb/documentation

Licence:

Open Source

Administration tool: 

phpmyadmin


PostgreSQL:



PostgreSQL the worlds most advanced open source database w3workers
PostgreSQL the worlds most advanced open source database

PostgreSQL is worlds most advanced open source database management system if you planing to make new PHP application in that case you should use postgreSQL instead of MySQL or MariaDB.


WebSite:

link: www.postgresql.org

Documentation:

link: www.postgresql.org/docs

Licence:

Open Source

Administration tool:

phppgadmin

Oracle:

Oracle worlds most popular and advanced database management system w3workers
Oracle worlds most popular and advanced database management system
Oracle is worlds most advanced and secure database management system but it's not open source you have to buy commercial licence for oracle database. 

Oracle also own MySQL under oracle organization but MySQL still available opensource under oracle.


WebSite:

link: www.oracle.com/index.html

Documentation:

link: docs.oracle.com/en/database

Licence:

link: www.oracle.com/us/corporate/pricing/price-lists/index.html

Administration tool:

phporacleadmin


MSSQL:



Microsoft SQL server powerful dbms w3workers
Microsoft SQL server powerful dbms

Microsoft SQL server is also powerful database management system with commercial licence.


WebSite:

link: www.microsoft.com/en-in/server-cloud/products/sql-server

Documentation:

link: msdn.microsoft.com/en-us/library/ms130214.aspx

Licence:

link: www.microsoft.com/en-in/server-cloud/products/sql-server/purchasing.aspx


SQLite:

SQLite most widely deployed database engine w3workers
SQLite most widely deployed database engine


SQLite is an embedded SQL database engine. SQLite reads and writes directly to ordinary disk files.

Complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.  

SQLite is not as a replacement for MySQL,PostgreSQL,MariaDB etc but as a replacement for FileSystem like fopen().


WebSite:

link: www.sqlite.org

Documentation:

link: www.sqlite.org/docs.html

Licence:

Open Source


these database are fully supported php and having powerful features.




Thanks for reading if you have any question add in comments section.

Saturday, 16 July 2016

JSON in MySQL



JSON And MySQL w3workers
JSON And MySQL
JavaScript Object Notation(JSON) is now most popular standard for exchanging data.
JSON is language independent and supports by all programming scripts.
JSON is lighted weighted string and having syntax like array to store values in keys.
JSON is also alternative for replacing traditional data exchanging standard XML.

Since JSON became standard for exchanging data between APIs, Most of the API in php, java, nodejs, phython, ruby, javascript, ASP etc are encouraging data exchanging with JSON.

So latest MySQL 5.7 is launched with JSON data type, Now JSON is available as a datatype in MySQL.

Just like int, varchar, text, longtext Now JSON is also a datatype for storing data into MySQL database.

Basically JSON is a string so most of the programmers started storing large arrays into database by converting it into JSON in text or longtext datatype.
and cause of it's popularity MySQL 5.7 providing a standard JSON datatype to encouraging programmers to keep use JSON for storing data into JSON strings.

Also MySQL 5.7 providing direct operations on JSON so now you can create SQL Queries for merging JSON or counting keys of JSON directly with SQL queries.

Below is detailed Description of MySQL 5.7 latest functions:

JSON_ARRAY()         

This will return JSON array

SELECT  JSON_ARRAY(1, "abc", NULL, TRUE, CURTIME())

OUTPUT : [1, "abc", null, true, "11:30:24.000000"]

JSON_APPEND() / JSON_ARRAY_APPEND()

JSON_APPEND() function is replaced by JSON_ARRAY_APPEND() in latest version.

For appending data at the end of JSON string.

Example:

SET @json = '{"x": 1}';
SELECT JSON_ARRAY_APPEND(@json, '$',  'z');

OUTPUT : [{"x": 1}, "z"] 

JSON_ARRAY_INSERT() 

For inserting element into JSON array

SET @json = '["x", {"z": [21]}, [80, 81]]';
SELECT JSON_ARRAY_INSERT(@json, '$[1]', 'y');

OUTPUT : ["x", "y", {"z": [1, 2]}, [3, 4]]

JSON_EXTRACT()

For extracting element from JSON array

SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]');

OUTPUT : 20


JSON_CONTAINS() 

This will return 1 
if value match to specified key 
This will return 0
if value not match to specified key


SET @json = '{"a": 1, "b": 2, "c": {"d": 4}}';

SELECT JSON_CONTAINS(@json,'1', '$.a');
OUTPUT : 1

JSON_CONTAINS_PATH() 

This will check one or all JSON path
if match specified path this will return 1.
if not match specified path this will return 0.

SET @json = '{"a": 1, "b": 2, "c": {"d": 4}}';
SELECT JSON_CONTAINS_PATH(@json, 'one', '$.a');

OUTPUT : 1


JSON_DEPTH()

This will return maximum depth of JSON 

SELECT JSON_DEPTH('[10, {"a": 20}]');

OUTPUT : 3


JSON_KEYS() 

This will return Array of keys from JSON

SELECT JSON_KEYS('{"a": 1, "b": {"c": 30}}');

OUTPUT : ["a", "b"]                            |



JSON_LENGTH() 

This will return Number of elements from JSON 

SELECT JSON_LENGTH('[1, 2, {"a": 3}]');

OUTPUT : 3


JSON_MERGE() 

This will merge JSON strings

SET  @json1='[1, 2]',
SET  @json2='["a", "b"]',
SET  @json3='[true, false]'
SELECT JSON_MERGE(json1,json2,json3 );

OUTPUT : [1, 2, "a", "b", true, false]


JSON_OBJECT()

This will create JSON object

SELECT JSON_OBJECT('id', 87, 'name', 'carrot');

OUTPUT : {"id": 87, "name": "carrot"}


JSON_QUOTE() 

This will quote JSON string

SELECT JSON_QUOTE('[1, 2, 3]');

OUTPUT : "[1, 2, 3]"


JSON_REMOVE() 

This will be remove data from JSON string

SET @json = '["a", ["b", "c"], "d"]';
SELECT JSON_REMOVE(@json, '$[1]');

OUTPUT : ["a", "d"]

JSON_REPLACE() 

This will replace values in JSON string

SET @json = '{ "a": 1, "b": [2, 3]}';
SELECT JSON_REPLACE(@json, '$.a', 10);

OUTPUT : {"a": 10, "b": [2, 3]}                              |


JSON_SEARCH() 

This will retrun path to value within JSON

SET @json = '["abc", [{"k": "10"}, "def"], {"x":"abc"}]';
SELECT JSON_SEARCH(@json, 'all', 'abc');

OUTPUT : ["$[0]", "$[2].x"]

JSON_SET() 

This will Insert data into JSON

SET @j = '{ "a": 1, "b": [2, 3]}';
SELECT JSON_SET(@j, '$.a', 10, '$.c', '[true, false]');

OUTPUT : {"a": 10, "b": [2, 3], "c": "[true, false]"}

JSON_TYPE() 

This will return type of JSON value

SET @j = '{"a": [10, true]}';
SELECT JSON_TYPE(@j);

OUTPUT : OBJECT        


JSON_UNQUOTE() 

This will unquote JSON value

SET @j = '"abc"';
SELECT JSON_UNQUOTE(@j);

OUTPUT : abc

JSON_VALID() 

This will check whether JSON value is valid or not
if valid then return 1

SELECT JSON_VALID('{"a": 1}');

OUTPUT : 1


These are new functions which is now supported in MySQL for 
performing operation on JSON.


Thanks for reading if you have any question add in comments section.

Sunday, 10 July 2016

List of free web hosting providers for php and mysql


Free Web Hosting W3workers
PHP AND MYSQL FREE WEB HOSTING

PHP is now most popular open source programming script and its becoming first choice of beginners, with the help of PHP now all type of web application development possible.

PHP web application required web hosting to make application live and accessible to world and web hosting resources are not cheaper for large and complex web application such as eCommerce or email marketing this type of application required high configuration server CPU memory traffic and monitoring real time alerts big storage etc.

But if we talking about small application static or dynamic application with small database we have so many option available to run website free of cost with the help of PHP free hosting providers.

Free web hosting having limitation and terms and conditions so its not good for complex and heavy traffic application.

But in case if you want a testing server for your WordPress theme or some small PHP website you want to run live then these hosting server is very useful.

List of top free php hosting providers


These are free hosting provider since long time  for PHP and MySql websites below is details and description.


1)  000webhost :

free web hosting w3workers
000webhost



This is the most reliable free web hosting provider since 2007 and they are committed that they will provide free web hosting forever.


Site: 


www.000webhost.com/free-php-hosting


Features:


  • 100GB of bandwidth
  • 1500MB storage disk Space
  • Free cpanel and web hosting admin panel
  • PHP and MySql database support
  • CMS wordpress joomla installation
  • Free Email service by IMAP/POP3
  • No ads No banners

2) byet.host: 

Free web hosting w3workers
byet.host


This is also good and reliable free hosting service and you can use for small websites.


Site:


byet.host/free-hosting


Features:


  • 1000MB storage disk space
  • FTP account file manager
  • Control panel
  • PHP and MySql database support
  • Free technical support
  • No ads


3) hostinger:

free web hosting w3workers
hostinger


Hostinger is free and reliable hosting for PHP and MySql 


Site:


www.hostinger.in/


Features:


  • 2000MB storage disk Space
  • 100GB traffic 
  • PHP and MySql Database Support
  • CMS WordPress Joomla Auto installation
  • No ads No banners

4) freewebhostingarea:


free web hosting w3workers
freewebhostingarea


They are providing free web hosting service since 2005

and having good support for PHP and MySQL websites but its not ads free.

Site:


freewebhostingarea.com 


Features:


  • 1500MB storage disk space
  • Max file size upto 12MB
  • Multi CPU server with 32/64 GB RAM
  • Need atleast 1 visit in a month
  • PHP and MySql support
  • Not Ads free (need $1 per month to make ads free)

5) awardspace:
free web hosting w3workers
awardspace
Free web hosting service for PHP and MySql

Site:

www.awardspace.com

Features:
  • 1GB storage disk space
  • 5GB traffic
  • PHP5 and 1 MySql Database
  • CMS WordPress Joomla Installer
  • No Ads 
6) x10hosting:

free web hosting w3workers
x10hosting

X10hosting is assure that they are proving unlimited bandwidth and storage which is seems actually not possible in free hosting but they are providing resources without limits so this commitment makes this hosting awesome but its big challenge to allocate high configuration resources at no cost so maybe they could have hidden policies behind it.


Site:


x10hosting.com/free-web-hosting


Features:

  • Unlimited storage
  • Unlimited Bandwidth
  • CMS wordpress, joomla installation
  • PHP and MySql support

7) freehostia:
free web hosting w3workers
freehostia


freehostia is also providing some limited free resources for running php and mysql website but the resources provided by freehostia is
only good for small applications.

Site:

freehostia.com


Features:

  • One click installation for CMS wordpress, joomla
  • 250MB disk space
  • 6GB monthly traffic
  • PHP and MySql Support
  • 10MB storage for MySql 

8) 2freehosting

free web hosting w3workers
2freehosting

You can also try 2freehosting for your PHP website.

Site:

2freehosting.com

Features:
  • 20GB disk Space
  • 150GB bandwidh
  • free cpanel
  • PHP and MySql support



Thanks for reading if you have any question add in comments section.