Category : SQL


MySQL Query - How to select records of today to next Sunday ?

In this post, i am going to share with you how to get records of today to weekend by using mysql query. This is MySQL Query that you can easily use in your core PHP and PHP framework like Laravel, Codeigniter, cakephp etc project. If you require to get records this way, today is Tuesday and you need to get data from today to next Sunday that means Tuesday to Sunday. sometimes we require to fetch records from this way. It is not any predefine function for getting records this way but we can do it by using following MySQL pre-define function. <strong>1) date()</strong> <strong>2) now()</strong>.....

By Hardik Savani | March 24, 2017 | | 254 Viewer | Category : SQL
READ MORE

MySql comma separated column join in PHP Laravel 5

If we work in big application or project of Laravel Framework, sometimes we require to manage column value into comma separated because we can save memory of database. But if we store comma separated value in column with ids then it's difficult to inner join or left join and get records from another tables. However, SQL provide FIND_IN_SET() for checking value one by one, that way we can also search from comma separated value. FIND_IN_SET() will help to join with tables and we can simply get data. In this post, I will give you full example of how to get data from comma separated column table.....

By Hardik Savani | January 7, 2017 | | 2687 Viewer | Category : SQL
READ MORE

How to connect mysql database in node js with example?

Node.js is very popular in Todays for make chat system, real-time notification, real-time developing etc. So, Today, I am going to give you very simple example of How to use MySQL Query in Node JS. If you use node.js then you can see how it is work and there are several driver for different task like redis, socket io, express etc. But Node.js have a driver for MySQL that way we can easily connect with database and you can use select, insert, update and delete sql query. So, in this example i going to give from scratch so if you are beginner and you haven't installed nodejs on your server th.....

By Hardik Savani | September 29, 2016 | | 1072 Viewer | Category : SQL
READ MORE

Example of trigger on after delete with update query mysql

Sometimes we need to fire trigger like after delete update some fields of another tables. for example if you have chat_message tables and when remove row on this table then we need to update "remove_counter(remove_counter + 1)" on users table. i did give you bellow example you can see how to write trigger code: <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> delimiter // CREATE TRIGGER add_ban_counter_in_users AFTER DELETE ON `chat_messages` FOR EACH ROW BEGIN UPDATE `users` SET remove_counter = users.remove_counter + 1 WHERE users.id = old.user_id.....

By Hardik Savani | April 5, 2016 | | 949 Viewer | Category : SQL
READ MORE

Sql function remove numeric characters from column example

Mysql custom fucntion is a very prety and intresting concept. In this posts i want to create one custom mysql function for remove numeric characters from table field value. this function through you can also remove numeric characters from string in mysql. in following sql query fire in your mysql or mssql database and check how it works. So, lets create function and how to use in select statement in sql query. <strong class="step">Create removeNumber function:</strong> <pre class="prettyprint lang-mysql"> DROP FUNCTION IF EXISTS removeNumber; DELIMITER | CREATE FUNCTION removeNumber( str CH.....

By Hardik Savani | March 12, 2016 | | 710 Viewer | Category : SQL
READ MORE

How to remove special characters by mysql custom function.

Mysql custom fucntion is a very prety and intresting concept. In this posts i want to create one custom mysql function for remove special characters from table field value. this function through you can also remove special characters from string in mysql. in following sql query fire in your mysql or mssql database and check how it works. So, lets create function and how to use in select statement in sql query. <strong class="step">Create removeSpacialChar function:</strong> <pre class="prettyprint lang-mysql"> CREATE FUNCTION `removeSpacialChar`(`in_str` varchar(4096)) RETURNS varchar(4096) C.....

By Hardik Savani | March 10, 2016 | | 1846 Viewer | Category : SQL
READ MORE

    Laravel Jquery Ajax Pagination Example From Scratch

    Laravel Jquery Ajax Pagination Example From Scratch

    Open Post

    Crop, Resize, Frames etc on selected image in php using Aviary

    Crop, Resize, Frames etc on selected image in php using Aviary

    Open Post

    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Open Post

    Mailgun setup with Laravel 5 example

    Mailgun setup with Laravel 5 example

    Open Post

    Select box with search option example in Jquery using Chosen Plugin

    Select box with search option example in Jquery using Chosen Plugin

    Open Post

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 1

    Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 1

    Open Post