Triggers in MySQL

10:57 AM Unknown 0 Comments


MySQL Triggers

In this section, you will learn how to work with the MySQL triggers. By definition, a trigger or database trigger is a stored program executed automatically to respond to a specific event e.g.,  insert, update or delete occurred in a table.
The database trigger is powerful tool for protecting the integrity of the data in your MySQL databases.(http://www.mysqltutorial.org/mysql-triggers.aspx) 

Create the database

After this little definition about triggers let's make something worthy.
problematic :We need to generate a profile for every new user added to data base.

1.Create the data base ,our database name is "test"

2.Create the triggers 


DROP TRIGGER IF EXISTS `mytrigger` ;

CREATE DEFINER = `root`@`localhost` TRIGGER `mytrigger` AFTER INSERT ON `users` 
FOR EACH
ROW BEGIN 
INSERT INTO profile( user_id, username, photo ) 
VALUES (
new.id, new.username, "/img/default.jpg"
);

END




How it works ?

All you need is watching this video that explain step by step how to create it .










Download the project

https://drive.google.com/file/d/0B0FucB-or3U5S18wZjRTOUZ0T3c/view?usp=sharing

bootstrap 3 sublime snippets

11:32 AM Unknown 0 Comments


Even though SublimeText comes with a bunch of great features that help our work as web developers, like any other tool, there will always be a room for enhancements. This is when plugins can be real useful .
Bootstrap snippets is really useful when you deal with the bootstrap framework to enhance writing code and adding component to you projects.

Installation

 1.download the package from Githubhttps://github.com/JasonMortonNZ/bs3-sublime-plugin
2.Extract the zip file
3.open Sublime Edit Text
click Preferences=>Browse packages(small windows w'll be opened with bunch of files)

4.CUT/Past the exctracted file into this window

Bootstrap style -rock out it's works :p

 Let's Star The Fun
let's add now new web page(waw it's blink :p ,let's bootstrap it)



click:                           Ctrl+Shift+p
main menu w'll be appears
in the search bar bs3-html5-template
Running the Code :D

(i have added navbar here :D it's look really good bs3-navbar)

Submit form without refresh the page

3:36 PM Unknown 0 Comments



1.Overview

Many people asks about ajax and jquery and we can use this ,in real project ,so , i have wrote this post to make it easy for you to getting started with ajax and some codes in Jquery.

2.What is Ajax ?!! 

Ajax is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. The best definition I've read for Ajax is “the method of exchanging data with a server, and updating parts of a web page - without reloading the entire page.”
read more here :
http://www.seguetech.com/blog/2013/03/12/what-is-ajax-and-where-is-it-used-in-technology

3.Basic ajax request structure

<script type="text/javascript">
$.ajax({

url:"TestPage.php",
data:data,
success:function(message)
{
//do something after the callback
}

});
</script>

4.Getting Started

i have posted a video on Youtube you can watch from this link 



Simple Client/Serveur application-TCP in C#

11:56 PM Unknown 0 Comments