September 5, 2016

PHP - MariaDB database connection.



Hello everyone, this this simple way to connect MariaDB with PHP,

Here I explain with simple example.

Example:

<?php
$connection=mysqli_connect("hostname","username","password");
$db = mysqli_select_db("databasename");
if (mysqli_connect_errno())
{
echo "Connection Failed with MariaDB:" . mysqli_connect_error();
}
?>

Enjoy!


September 4, 2016

MySQL select query to inner join two table in single field.




MySQL select Query to inner joint two tables on single field.

SELECT CASE

WHEN STATUS_FLAG=1 THEN (select id from table2 where id=TABLE1.F_ID)

ELSE (select id from table3 where id=TABLE1.F_ID)

END


FROM TABLE1

MySQL select query with case and when condition.



Here I explain CASE and WHEN condition with MySQL select query.

MySQL Example:

SELECT CASE

          WHEN STATUS_FLAG=1 THEN ‘Yes’ ELSE ‘No’

           END AS STATUS_FLAG


FROM TABLE1


Enjoy!

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...