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!

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...