SQL Statement | Syntax |
---|---|
AND / OR | SELECT column_name(s) FROM table_name WHERE condition AND|OR condition |
ALTER TABLE | ALTER TABLE table_name ADD column_name datatypeor ALTER TABLE table_name DROP COLUMN column_name |
AS (alias) | SELECT column_name AS column_alias FROM table_nameor SELECT column_name FROM table_name AS table_alias |
BETWEEN | SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2 |
CREATE DATABASE | CREATE DATABASE database_name |
CREATE TABLE | CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name2 data_type, ... ) |
CREATE INDEX | CREATE INDEX index_name ON table_name (column_name)or CREATE UNIQUE INDEX index_name ON table_name (column_name) |
CREATE VIEW | CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition |
DELETE | DELETE FROM table_name WHERE some_column=some_valueor DELETE FROM table_name (Note: Deletes the entire table!!) DELETE * FROM table_name (Note: Deletes the entire table!!) |
DROP DATABASE | DROP DATABASE database_name |
DROP INDEX | DROP INDEX table_name.index_name (SQL
Server) DROP INDEX index_name ON table_name (MS Access) DROP INDEX index_name (DB2/Oracle) ALTER TABLE table_name DROP INDEX index_name (MySQL) |
DROP TABLE | DROP TABLE table_name |
EXISTS | IF EXISTS (SELECT * FROM table_name WHERE id = ?) BEGIN --do what needs to be done if exists END ELSE BEGIN --do what needs to be done if not END |
GROUP BY | SELECT column_name,
aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name |
HAVING | SELECT column_name,
aggregate_function(column_name) FROM table_name WHERE column_name operator value GROUP BY column_name HAVING aggregate_function(column_name) operator value |
IN | SELECT column_name(s) FROM table_name WHERE column_name IN (value1,value2,..) |
INSERT INTO | INSERT INTO table_name VALUES (value1, value2, value3,....)or INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,....) |
INNER JOIN | SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name |
LEFT JOIN | SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2 ON table_name1.column_name=table_name2.column_name |
RIGHT JOIN | SELECT column_name(s) FROM table_name1 RIGHT JOIN table_name2 ON table_name1.column_name=table_name2.column_name |
FULL JOIN | SELECT column_name(s) FROM table_name1 FULL JOIN table_name2 ON table_name1.column_name=table_name2.column_name |
LIKE | SELECT column_name(s) FROM table_name WHERE column_name LIKE pattern |
ORDER BY | SELECT column_name(s) FROM table_name ORDER BY column_name [ASC|DESC] |
SELECT | SELECT column_name(s) FROM table_name |
SELECT * | SELECT * FROM table_name |
SELECT DISTINCT | SELECT DISTINCT column_name(s) FROM table_name |
SELECT INTO | SELECT * INTO new_table_name [IN externaldatabase] FROM old_table_nameor SELECT column_name(s) INTO new_table_name [IN externaldatabase] FROM old_table_name |
SELECT TOP | SELECT TOP number|percent column_name(s) FROM table_name |
TRUNCATE TABLE | TRUNCATE TABLE table_name |
UNION | SELECT column_name(s) FROM table_name1 UNION SELECT column_name(s) FROM table_name2 |
UNION ALL | SELECT column_name(s) FROM table_name1 UNION ALL SELECT column_name(s) FROM table_name2 |
UPDATE | UPDATE table_name SET column1=value, column2=value,... WHERE some_column=some_value |
WHERE | SELECT column_name(s) FROM table_name WHERE column_name operator value |
Bollywood and Hollywood movies are the most watched movies in the world. Action Drama, full of story lines Sport Entertainment news. Gossip World Chat
Friday, November 7, 2014
SQL Statement
Saturday, November 1, 2014
AngularJS Tutorial Part 1
AngularJS Tutorial
AngularJS extends HTML with new attributesAngularJS is perfect for SPAs (Single Page Applications)
AngularJS is easy to learn
Try it Yourself Examples in Every Chapter
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
</body>
</html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
</body>
</html>
What
You Should Already Know
Before you study AngularJS, you
should have a basic understanding of:
- HTML
- CSS
- JavaScript
AngularJS Introduction
AngularJS is a JavaScript framework. It can be
added to an HTML page with a <script> tag.
AngularJS extends HTML attributes with Directives,
and binds data to HTML with Expressions.
AngularJS is a JavaScript Framework
AngularJS is a JavaScript framework. It is a library written in JavaScript.AngularJS is distributed as a JavaScript file, and can be added to a web page with a script tag:
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
AngularJS Extends HTML
AngularJS extends HTML with ng-directives.The ng-app directive defines an AngularJS application.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
The ng-bind directive binds application data to the HTML view.
Example explained:
AngularJS starts automatically when the web page has loaded.
The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application.
The ng-model directive binds the value of the input field to the application variable name.
The ng-bind directive binds the innerHTML of the <p> element to the application variable name.
![]() |
You can use data-ng-,
instead of ng-, if you want to make your page HTML5 valid.
|
AngularJS
Expressions
AngularJS expressions are written
inside double braces: {{ expression }}.
AngularJS expressions bind data to
HTML the same way as the ng-bind directive.
AngularJS will "output"
data exactly where the expression is written.
AngularJS
Example
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>My first expression: {{ 5 + 5 }}</p>
</div>
</body>
</html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="">
<p>My first expression: {{ 5 + 5 }}</p>
</div>
</body>
</html>
AngularJS Directives
AngularJS lets you extend HTML with new attributes called Directives.
AngularJS Directives
AngularJS directives are extended HTML attributes with the prefix ng-.The ng-app directive initializes an AngularJS application.
The ng-init directive initialize application data.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-init="firstName='John'">
<p>Input something in the input box:</p>
<p>Name: <input type="text"
ng-model="firstName"></p>
<p>You wrote: {{ firstName }}</p>
</div>
</body>
</html>
Data
Binding
The {{ firstName }}
expression, in the example above, is an AngularJS data binding expression.
Data binding in AngularJS,
synchronizes AngularJS expressions with AngularJS data.
{{ firstName }} is synchronized with ng-model="firstName".
AngularJS is perfect for database
CRUD (Create Read Update Delete) applications.
Just imagine if these objects were records from a database. |
Repeating
HTML Elements
The ng-repeat directive
repeats an HTML element:
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-init="names=[
{name:'Jani',country:'Norway'},
{name:'Hege',country:'Sweden'},
{name:'Kai',country:'Denmark'}]">
<p>Looping with objects:</p>
<ul>
<li
ng-repeat="x in names">
{{ x.name + ', ' +
x.country }}</li>
</ul>
</div>
</body>
</html>
![]() |
AngularJS is perfect for database CRUD (Create Read Update
Delete) applications.
Just imagine if these objects were records from a database. |
The ng-app Directive
The ng-app directive defines the root element of an AngularJS application.The ng-app directive will auto-bootstrap (automatically initialize) the application when a web page is loaded.
Later you will learn how ng-app can have a value (like ng-app="myModule"), to connect code modules.
The ng-init Directive
The ng-init directive defines initial values for an AngularJS application.Normally, you will not use ng-init. You will use a controller or module instead.
You will learn more about controllers and modules later.
The ng-model Directive
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.The ng-model directive can also:
- Provide type validation for application data (number, email, required).
- Provide status for application data (invalid, dirty, touched, error).
- Provide CSS classes for HTML elements.
- Bind HTML elements to HTML forms.
The ng-repeat Directive
The ng-repeat directive clones HTML elements once for each item in a collection (in an array).AngularJS Controllers
AngularJS controllers control the data of
AngularJS applications.
AngularJS controllers are regular JavaScript Objects.
AngularJS Controllers
AngularJS applications are controlled by controllers.The ng-controller directive defines the application controller.
A controller is a JavaScript Object, created by a standard JavaScript object constructor.
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="personController">
First Name: <input type="text"
ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>
<script>
function personController($scope) {
$scope.firstName =
"Kumar",
$scope.lastName =
"Suresh"
}
</script>
</body>
</html>
Application explained:
The AngularJS application is defined
by ng-app. The application runs inside a <div>.
The ng-controller directive
names the controller object.
The personController function
is a standard JavaScript object constructor.
AngularJS will invoke
personController with a $scope object.
In AngularJS, $scope is the
application object (the owner of application variables and functions).
The personController creates two
properties (variables) in the scope (firstName and lastName).
The ng-model directives bind
the input fields to the controller properties (firstName and lastName).
Controller
Methods
The example above demonstrated a
controller object with two properties: lastName and firstName.
A controller can also have methods
(functions as object properties):
AngularJS Filters
Filters can be added to expressions and directives using a pipe
character.
AngularJS Filters
AngularJS filters can be used to transform data:
Filter
|
Description
|
currency
|
------Format a number to a currency format.
|
Filter
|
------Select a subset of items from an array.
|
lowercase
|
------Format a string to lower case.
|
orderBy
|
------Orders an array by an expression.
|
uppercase
|
------Format a string to upper case.
|
Adding Filters to Expressions
A filter can be added to an expression with a pipe character (|) and a filter.(For the next two examples we will use the person controller from the previous chapter)
The uppercase filter format strings to upper case:
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="personController">
<p>The name is {{ lastName | uppercase }}</p>
</div>
<script
src="personController.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="personController">
<p>The name is {{ lastName | lowercase }}</p>
</div>
<script
src="personController.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="costController">
Quantity: <input type="number"
ng-model="quantity">
Price: <input type="number"
ng-model="price">
<p>Total = {{ (quantity * price) | currency
}}</p>
</div>
<script>
function costController($scope) {
$scope.quantity =
1;
$scope.price =
9.99;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="namesController">
<p>Looping with objects:</p>
<ul>
<li
ng-repeat="x in names | orderBy:'country'">
{{ x.name + ', ' +
x.country }}
</li>
</ul>
</div>
<script
src="namesController.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app=""
ng-controller="namesController">
<p>Filtering input:</p>
<p><input type="text"
ng-model="test"></p>
<ul>
<li
ng-repeat="x in names | filter:test | orderBy:'country'">
{{ (x.name |
uppercase) + ', ' + x.country }}
</li>
</ul>
</div>
<script
src="namesController.js"></script>
</body>
</html>
Monday, October 13, 2014
PUSH NOTIFICATION FOR ANDROID ( PHP )
for push notification you have to use only this code.. not more programing is required...
// this is the google apis url.. not need to change..
$url = 'https://android.googleapis.com/gcm/send';
//$fieds is an array and $registatoin_ids is a device id for which you have to create push notification
//if you create push notification for multiple device then use $registatoin_ids as
// device id is a device token which is unique for every device/cellphone
//$registatoin_ids = array(deviceid 1, device id 2, device id 3,.....);
$message = array("You have receiving a push notification");
//$message is a text which you want to send.. in message
$fields = array(
'registration_ids' => $registatoin_ids,
'data' => $message,
);
//GOOGLE_API_KEY use here google server key which is made by android developer..
// we use GOOGLE BROWSER Key
$headers = array(
'Authorization: key=' . GOOGLE_API_KEY,
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
// Execute post
$result = curl_exec($ch);
if ($result === FALSE) {
die('Curl failed: ' . curl_error($ch));
}
// Close connection
curl_close($ch);
echo $result;
// if your code is fine then result give you the response and success 1 if you got error then result give you error message.. or failure 1
// this is the google apis url.. not need to change..
$url = 'https://android.googleapis.com/gcm/send';
//$fieds is an array and $registatoin_ids is a device id for which you have to create push notification
//if you create push notification for multiple device then use $registatoin_ids as
// device id is a device token which is unique for every device/cellphone
//$registatoin_ids = array(deviceid 1, device id 2, device id 3,.....);
$message = array("You have receiving a push notification");
//$message is a text which you want to send.. in message
$fields = array(
'registration_ids' => $registatoin_ids,
'data' => $message,
);
//GOOGLE_API_KEY use here google server key which is made by android developer..
// we use GOOGLE BROWSER Key
$headers = array(
'Authorization: key=' . GOOGLE_API_KEY,
'Content-Type: application/json'
);
// Open connection
$ch = curl_init();
// Set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Disabling SSL Certificate support temporarly
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
// Execute post
$result = curl_exec($ch);
if ($result === FALSE) {
die('Curl failed: ' . curl_error($ch));
}
// Close connection
curl_close($ch);
echo $result;
// if your code is fine then result give you the response and success 1 if you got error then result give you error message.. or failure 1
Labels:
PHP Android push notification
Location:
Nalagarh, Himachal Pradesh, India
Sunday, October 5, 2014
Frameworks to Build Mobile Application with HTML, CSS & JavaScript
For many web developers, which may only be familiar with HTML, CSS, and JavaScript, developing a native mobile app could be unfamiliar territory.
Technically speaking, mobile apps in Android, iOS, and Windows Phone
are built using completely different programming languages; an Android
app uses Java, an iOS app uses Objective-C, while a Windows Phone app uses .NET.
But now, anyone with a decent knowledge of HTML, CSS, and JavaScript can build a mobile application. One key advantage of using web technology to build your app is Portability. Using a packager/compiler, like PhoneGap, you will be able to port and install your app on many different platforms.
There are a number of frameworks that make this possible. They also have done half of the hard work to bridge the gap between web and mobile platforms. Here we have put together 10 of the best mobile frameworks that we could find. If you are ready to build the next billion-dollar app let’s check out the list.
But now, anyone with a decent knowledge of HTML, CSS, and JavaScript can build a mobile application. One key advantage of using web technology to build your app is Portability. Using a packager/compiler, like PhoneGap, you will be able to port and install your app on many different platforms.
There are a number of frameworks that make this possible. They also have done half of the hard work to bridge the gap between web and mobile platforms. Here we have put together 10 of the best mobile frameworks that we could find. If you are ready to build the next billion-dollar app let’s check out the list.
1. jQuery Mobile
jQueryMobile is a robust mobile development framework to build cross-mobile-platform app. jQuery Mobile support a wide range of different platforms, from a regular desktop, smart phone, tablet, or an e-reader device like Nook or Kindle. Similar to its sibling, jQuery UI, jQuery Mobile comprises a number of UI that, in this case, is optimized for mobile and touch-enabled devices.2. Cordova / PhoneGap
PhoneGap is essentially based on Cordova. Cordova/Phonegap provides a set JavaScript APIs that connect to the device’s native functions such as Camera, Compass, Contacts, and Geolocation. Cordova/Phonegap lets us build a mobile application without the native programming language; instead we can use a framework like jQuery Mobile. It will compile your app using the platform’s SDK and will be ready to install on the platform it supports including iOS, Android, Windows Phone, Blackberry and Web OS.3. Sencha Touch
Sencha Touch is a mobile framework powered by HTML5 and CSS3, providing APIs, animations, and components that are compatible with the current mobile platforms and browsers. Sencha Touch supports both Cordova and PhoneGap; you can compile your app, and submit your app to the respective platform’s App Stores. In addition, Sencha Touch provides a set of themes for iOS, Android, Blackberry, Windows Phone, Tizen, and a variety of other platforms to help your app feel like a native app.4. Ratchet
Ratchet was originally used by Twitter as an internal tool to create their mobile app prototype which is then released publicly as an open source project. Ratchet comes with a collection of User Interface and JavaScript plugins for building simple mobile apps, providing reusable HTML classes. In version 2.0, Ratchet is also shipped with its proprietary font icon set named Ratcheticon and two pre-made UI themes for iOS and Android.5. Ionic
If you are concerned with your app performance, Ionic is the right framework for you. Ionic is an HTML5 mobile framework with focus on performance, by leveraging hardware acceleration, and it requires no third-party JS library. It works best together with Angular.js to build an interactive app. Similar to Ratchet, Ionic is shipped with a nicely crafted font icon set, Ionicons, and a bunch of reusable HTML classes to build the mobile UI.6. Lungo
Lungo is a lightweight mobile framework based on HTML5 and CSS3. It has very nice default styles that you can use as a starting point to design your mobile app. Aside for the mobile UI components, Lungo brings a number of JavaScript API to control your app. Lungo supports the following platforms: iOS, Android, Blackberry and Firefox OS.7. jQT
jQT is a Zepto plugin for mobile framework primarily designed for Webkit browsers. jQT is easily customizable and extensible. It comes with a theme that can be modified using Sass/Compass, cool 3D transition that is adjustable via CSS3, plus developers could also extend jQT with their own required functionalities.8. Junior
Junior is also a Zepto plugin for building a mobile app similar to jQT. But Junior is dependent on several external libraries for some features to work, namely Backbone.js, Flickable.js for creating a swipe-able slider, and Ratchet for the UI scaffold.9. Jo
Jo supports a wide variety of mobile platforms including Tizen and Chrome OS. Jo also comes with a starter, that is powered by CSS3, so it makes it easy for web developers at any level of experience to grasp and start styling their apps. In addition, you can use Jo along with PhoneGap or Cordova to pack your app for use on mobile platform.10. Famo.us
A new kid on the mobile framework block, Famo.us promises to eliminate HTML5 performance issue on mobile devices with its lightweight JavaScript engine (only 64k). Famo.us, reportedly, will a also launch a cloud-based service to package your app to publish to the AppStore – it sounds like Phonegap and Sencha will get a new competitor soon. You can sign up as a beta tester in www.famo.us to get your hands on it.
Location:
Panjehra, Himachal Pradesh 174101, India
Monday, September 29, 2014
My All Time Work
Opencart
- Agriko ( 2 member )
- Healty N Fit ( Indivisual )
- Shoe Lovers ( Indivisual )
- Alpha Flags ( Indivisual )
- CanConcepts ( Indivisual )
- Easy Flow Shop ( Indivisual )
- Classic Turkish Towels ( 2 Member )
- Sacha Sauda Khalsa ( 2 Member )
- Sexy Party Wears ( 2 Member )
Phonegap:
- CrackIAS ( Indivisual )
- Event Manager ( Indivisual )
Smarty:
- Refurb Pro (2 members)
- Paaltu ( 2 members )
- Fix ICE (2 members )
- Ice And Wine (2 members )
- Ice Machine Clearance ( 2 members )
- Time Cafe ( Indivisual )
- Orbis Realty ( 2 members )
- LaryngoStore ( Indivisual )
- Aurakitchens ( 2 mambers )
- Emozioni d'Imagine ( Indivisual )
- Summer Camp ( Indivisual )
- Meadowvale Optometry ( Indivisual )
- 24hourfilters ( 2 members )
Shopify:
- Support My Club ( Indivisual )
- Custom Romantic ( Indivisual )
- Whole Food Hub ( Indivisual )
Business Catalyst:
- WMO Design Agency ( Indivisual )
- Pacific Waste Systems ( Indivisual )
- http://www.pacificwastesystems.com/ ( Indivisual )
Wordpress:
- http://www.utahdancecenter.org/ ( Indivisual )
- http://vickersracing.co.uk/ ( 2 members )
- http://amebainfo.amebasoftwares.com/ ( 2 members )
- http://www.nerodesign.com.au/limetree/ ( Indivisual )
- http://www.nerodesign.com.au/ ( Indivisual )
- http://www.elementsproperty.com.au/ ( Indivisual )
- http://www.gobarrie.ca/ ( Indivisual )
- http://nextresidential.com.au/ ( Indivisual )
- http://www.instituteforcoaching.com/ ( 2 members )
- http://d3.rfdigital.com/ ( 2 members )
- http://art.foundationx.com/ ( Indivisual )
- amebainfo.amebasoftwares.com ( 2 members )
OsCommerce:
- http://stickershack.ca/ ( 2 members )
WebServices:
- Radio App http://radioapp.superlifecode.com/ ( Indivisual )
- StickerShack App http://stickershack.ca/ ( Indivisual )
- Fast Buy App ( Indivisual )
- Messenger App ( Indivisual )
- Taxi App ( Indivisual )
- Drive To Me ( Indivisual )
ILance :
- http://cokebid.com/ ( 2 members )
PHP:
- http://kanwarlimousines.com/ ( Indivisual )
- http://happytimelimo.com/ ( Indivisual )
- http://mybigdaylimousines.com/ ( Indivisual )
- http://www.easyflow.co.uk/ ( Indivisual )
- http://www.victorandpercy.com/ ( Indivisual )
- http://www.outdoormedia.co.in/ ( 2 members )
- http://thehairpeople.us/ ( Indivisual )
- http://www.bindaasproperty.com/ ( 2 members )
- http://classifieds.successcds.net/ ( Indivisual )
- http://www.gobarrie.ca/ ( Indivisual )
- http://www.bramaleaoptometry.com/ ( Indivisual )
- http://www.flyers4trade.com/ ( Indivisual )
Weebly:
- http://www.roninathletics.com/ ( Indivisual )
HTML
http://www.hpfinancialservices.ca/ ( Indivisual )Payment Gateways:
- PayU
- Paypal
- Authorize.Net
- Google Wallet
- RuPay
Tuesday, September 23, 2014
PHP skill test for PHP developers
Que.1 Who is called the father of PHP.
a) Larry Wall
b) Rasmus Lerdorf
c) James Gosling
d) Guido Van Rossum
b) echo() can be used as part of an expression, while print() cannot.
C) echo() can be used in the CLI version of PHP, while print() cannot.
D) both A and B
Que.4 The output of following script will be..
Que. 7 If property of class is declare using var then PHP5 will treat the property as?
Que. 8 What will be the output of following script?
<?php
$test="3.5seconds";
settype($test,"double");
settype($test,"integer");
settype($test,"string");
print($test);
?>
a) 3.5
b) 3.5seconds
c) 3
d) 3seconds
Que. 10 The output of following script will be..
<?php
$x=array(4,2,5,1,4,5,3,4);
$y=array_count_values($x);
echo count($y);
?>
a) 8
b) 7
c) 5
d) 28
a) Larry Wall
b) Rasmus Lerdorf
c) James Gosling
d) Guido Van Rossum
Que.2
What is the difference between
print() and echo()?
a)
print() can be used as part of an expression, while echo() cannot.b) echo() can be used as part of an expression, while print() cannot.
C) echo() can be used in the CLI version of PHP, while print() cannot.
D) both A and B
Que. 3
What is input sanitization?
a)
Secure user input
b)
Converting input into a format
that PHP supports
c)
Removing or cleaning potentially
malicious user input.
d)
All of the aboveQue.4 The output of following script will be..
$somerar=15;
function ad it () {
GLOBAL $somevar;
$somerar++ ;
echo "somerar is $somerar";
}
addit ();
a)
somerar is 15
b)
somerar is 16
c)
somerar is 1
d)
somerar is $ somerar
Que.5
what will be the ouput of below code
? Assume that today is 2009-5-19:2:45:32 pm
<?php
$today
= date("F
j, Y, g:i a");
?>
a) may 19,09,2:45:32 PM |
b) May 19, 2009, 2:45 pm |
c) May 19,2009,14:45:32 pm |
d) May 19,2009,14:45:32 PM |
Que. 6 What is the name of function
used to convert an array into a string?
a)
explode()
b)
glue()
c)
implode()
D)
None of the aboveQue. 7 If property of class is declare using var then PHP5 will treat the property as?
a)
Protected
b)
Private
c)
Public
d)
FinalQue. 8 What will be the output of following script?
<?php
$test="3.5seconds";
settype($test,"double");
settype($test,"integer");
settype($test,"string");
print($test);
?>
a) 3.5
b) 3.5seconds
c) 3
d) 3seconds
Que.9
What is the name of function used to
convert an array into a string?
a)
explode()
b)
glue()
c)
implode()
d)
None of the above Que. 10 The output of following script will be..
<?php
$x=array(4,2,5,1,4,5,3,4);
$y=array_count_values($x);
echo count($y);
?>
a) 8
b) 7
c) 5
d) 28
Location:
Panjehra, Himachal Pradesh 174101, India
PHP developers : Check your skills
Que.1 Which one of the following PHP functions can be used to build a function that accepts any number of arguments?
a) func_get_argv()
b) func_get_argc()
c) get_argv()
d) get_argc()
Que.2 How many error levels are available in PHP?
a) 14
b) 15
c) 16
d) 17
Que.3 Which of the following statements invoke the exception class?
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
Que.4 Which of the following is/are an external data?
i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data
a) Only ii)
b) ii) and iii)
c) None of the mentioned
d) All of the mentioned
Que.5 The attack which involves the insertion of malicious code into a page frequented by other users is known as..
a) basic sql injection
b) advanced sql injection
c) cross-site scripting
d) scripting
Que.6 hich one of the following statements can be used to establish port 80 connection with www.nachi.com?
a) fsockopen(“www.nachi.com”, 80);
b) sockopen(80,”www.nachi.com”);
c) fsockopen(80,”www.nachi.com”);
d) sockopen(“www.nachi.com”, 80);
Que.7 What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.
a) 10
b) 20
c) 30
d) 40
Que.8 Which one of the following PHP functions can be used to find files?
a) glob()
b) file()
c) fold()
d) get_file()
Que.9 Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?
a) error_reporting = E_ALL
b) error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR
c) error_reporting = E_ERROR | E_COMPILE_WARNING | E_CORE_ERROR
d) error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR
Que.10 How many predefined exceptions does SPL (Standard PHP Library) provide access to?
a) 13
b) 14
c) 15
d) 16
a) func_get_argv()
b) func_get_argc()
c) get_argv()
d) get_argc()
Que.2 How many error levels are available in PHP?
a) 14
b) 15
c) 16
d) 17
Que.3 Which of the following statements invoke the exception class?
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
Que.4 Which of the following is/are an external data?
i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data
a) Only ii)
b) ii) and iii)
c) None of the mentioned
d) All of the mentioned
Que.5 The attack which involves the insertion of malicious code into a page frequented by other users is known as..
a) basic sql injection
b) advanced sql injection
c) cross-site scripting
d) scripting
Que.6 hich one of the following statements can be used to establish port 80 connection with www.nachi.com?
a) fsockopen(“www.nachi.com”, 80);
b) sockopen(80,”www.nachi.com”);
c) fsockopen(80,”www.nachi.com”);
d) sockopen(“www.nachi.com”, 80);
Que.7 What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.
a) 10
b) 20
c) 30
d) 40
Que.8 Which one of the following PHP functions can be used to find files?
a) glob()
b) file()
c) fold()
d) get_file()
Que.9 Say you want to report error concerned about fatal run-time, fatal compile-time error and core error which statement would you use?
a) error_reporting = E_ALL
b) error_reporting = E_ERROR | E_PARSE | E_CORE_ERROR
c) error_reporting = E_ERROR | E_COMPILE_WARNING | E_CORE_ERROR
d) error_reporting = E_ERROR | E_COMPILE_ERROR | E_CORE_ERROR
Que.10 How many predefined exceptions does SPL (Standard PHP Library) provide access to?
a) 13
b) 14
c) 15
d) 16
Location:
Panjehra, Himachal Pradesh 174101, India
PHP test : object oriented PHP-1
THEORY
a) Abstract
b) Protected
c) Final
d) Static
a) classname()
b) _construct()
c) function _construct()
d) function __construct()
a) class creation
b) object creation
c) object instantiation
d) class instantiation
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
Que.1
In the PHP code given below, what is/are the properties?
b) public $name;
c) class Example
d) function sample()
Que.2 What will be the output of the following PHP code?
b) bool(false)
c) Error
d) None of the above
Que. 3 What will be the output of the following PHP code?
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Que 4 What will be the output of the following code?
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
Que. 5 What will be the output of the following PHP code?
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Que. 1
Which method scope prevents a method
from being overridden by a subclass?
a) Abstract
b) Protected
c) Final
d) Static
Que.2
PHP recognizes constructors by the
name..
a) classname()
b) _construct()
c) function _construct()
d) function __construct()
Que 3
The practice of creating objects
based on predefined classes is often referred to as..
a) class creation
b) object creation
c) object instantiation
d) class instantiation
Que.4
The practice of
separating the user from the true inner workings of an application
through well-known interfaces is known as..
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
Que.5
Which version of PHP introduced the
instance of keyword?
a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
PROGRAMS :
<?php
class Example
{
public $name;
function Sample()
{
echo "This is an example";
}
}
?>
b) public $name;
c) class Example
d) function sample()
Que.2 What will be the output of the following PHP code?
<?php
class MyClass
{
}
$a = new MyClass;
var_dump(!($a instanceof stdClass));
?>
b) bool(false)
c) Error
d) None of the above
Que. 3 What will be the output of the following PHP code?
<?php
class ParentClass
{
}
class MyClass extends ParentClass
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof ParentClass);
?>
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Que 4 What will be the output of the following code?
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
Que. 5 What will be the output of the following PHP code?
<?php
interface MyInterface
{
}
class MyClass implements MyInterface
{
}
$a = new MyClass;
var_dump($a instanceof MyClass);
var_dump($a instanceof MyInterface);
?>
bool(false)
b) bool(true)
bool(true)
c) bool(false)
bool(true)
d) bool(true)
bool(false)
Labels:
PHP test : object oriented PHP-1
Location:
Panjehra, Himachal Pradesh 174101, India
Subscribe to:
Posts (Atom)