Gaurav Jassal
<?php Ideas are my bread n butter. I mold and shape them into living breathing interactive experiences and captivate. I believe that great interactive ideas drive on the tension between design and code. ?>
Info
(contact)

+44.7518.599.587
hello[at]gauravjassal[dot]com

<Filter Array into Categorized format/>

This simple yet powerful class to filters an array and breaks in to a categorized array format.You can use this class if you are dealing with large and complex array and want to convert it into and simple array that is easy to understand and use. Recently i required a function that can categorize an array and break it into categorize format.I couldn't find any core function to do that so i decided to create my own class that can do this job for me. I have also added an example to demonstrate the usage to its benefit. Make sure you comment it if you find it useful.

Original Array

$arrProducts=array(
        array(
        "product_id" 			=> "007",
        "product_name"      	=> "Blackberry R-900 Mobile",
        "product_price" 		=> "£450",
        "product_status"		=>"1",
        "product_category"		=>"Mobile"
        ),
		array(
        "product_id" 			=> "033",
        "product_name"      	=> "8 GB Pendrive",
        "product_price" 		=> "£14.99",
        "product_status"		=> "0",
        "product_category"		=> "Computers"
        )
);
<read complete article/>

<Why use Constraints in SQL ?/>

Constraints enables business rules to be enforced by the database instead of via application code. Through the judicious use of constraints, application and SQL coding can be minimized and data integrity can be maximized. Constraints may be applied to columns in the form of uniqueness requirements, relational integrity constraints to other tables/rows, allowable values and data types.For example, a column containing a product price should probably only accept positive values. But there is no standard data type that accepts only positive numbers. Another issue is that you might want to constrain column data with respect to other columns or rows. For example, in a table containing product information, there should be only one row for each product number.

With constraints you can have much control over the data and you can have it the way you want to be. You can have same rules in your web applications that you are writing in whatever language like PHP, ASP.NET, Perl, Python but constraints can save your alot of valuable time.

Constraints, in SQL Server, can be used to:

  • # Enforce the range of data values that can be stored in a column (check constraints) 
  • # Enforce the uniqueness of a column or group of columns within a table (unique / primary key constraints) 
  • # Eenforce referential integrity (primary key and foreign key constraints)

A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity.

CREATE TABLE products ( 
        product_no integer PRIMARY KEY, 
        name text, 
        price numeric
); 
<read complete article/>

<Google’s Project10tothe100/>

Google  came up with a new project called Project10tothe100  Google has sent an invitation to all the people who has an idea or ideas to change the world, just share the same with Google and help the people in all.

<read complete article/>
Page 1 of 4 pages  1 2 3 >  Last »

Wise Words

"If we know who we are, we will not try to become someone else in order to have value and meaning in our lives. If we don't know who we are, we will try to become someone who someone else wants us to be."

- Robert McGee

Social Things

Where you can fine me !!

View Gaurav Jassal's profile on LinkedIn

View Gaurav Jassal's profile on LinkedIn View Gaurav Jassal's profile on Delicious View Gaurav Jassal's profile on Digg View Gaurav Jassal's profile on Facebook View Gaurav Jassal's profile on feedburner View Gaurav Jassal's profile on flickr View Gaurav Jassal's profile on lastfm View Gaurav Jassal's profile on netvibes View Gaurav Jassal's profile on twitter RSS

Search Box


Advanced Search