Posts

Difference between unset() and unlink() in PHP

In PHP unlink() is a function for file system handling, unlink() is used to delete files (physical). Suppose you have uploaded a file and wants to delete this file through the coding then unlink() function is used to delete the file, Suppose you have an image with the name test.png and you wants to delete this image then use the <?php /****Condition*****/ /****Condition*****/ unlink(image path/test.png); /****Condition*****/ /****Condition*****/ ?> or <?php $xx = fopen('testing.html', 'a'); fwrite($xx, '<h1>Hello EWA!</h1>'); fclose($xx); unlink('testing.html'); ?> unset() is a function for variable management. It will make a variable undefined. Or we can say that unset() is used to null out the value of a given variable. OR Unset () is used to destroy a variable in PHP. In can be used to remove a single variable, multiple variables, or an element from an array. Example for unset() : <?php $value =

List of MySQLi function

The MySQLi functions allow you to access MySQL database servers. Note: The MySQLi extension is designed to work with MySQL version 4.1.13 or newer. Function Description mysqli_affected_rows() Returns the number of affected rows in the previous MySQL operation mysqli_autocommit() Turns on or off auto-committing database modifications mysqli_change_user() Changes the user of the specified database connection mysqli_character_set_name() Returns the default

PHP isset() vs empty() vs is_null()

PHP has different functions which can be used to test the value of a variable. Three useful functions for this are isset(), empty() and is_null(). All these function return a boolean value. If these functions are not used in correct way they can cause unexpected results. isset() and empty() are often viewed as functions that are opposite, however this is not always true. In this post I will explain the differences between these functions. isset() From PHP manual – isset(): isset — Determine if a variable is set and is not NULL In other words, it returns true only when the variable is not null. empty() From PHP Manual – empty(): empty — Determine whether a variable is empty In other words, it will return true if the variable is an empty string, false, is_null() From PHP Manual – is_null(): is_null — Finds whether a variable is NULL In other words, it returns true only when the variable is null. is_null() is opposite of isset(), except for one difference that i

AJAX Interview Questions

1) What are the usages of SQL? To execute queries against a database To retrieve data from a database To inserts records in a database To update records in a database To delete records from a database To create new databases To create new tables in a database To create views in a database 2) Does SQL support programming? No, SQL doesn't have loop or Conditional statement. It is used like commanding language to access databases. 3) What are the subsets of SQL? Data definition language (DDL) - Data definition language(DDL) allows you to CREATE, ALTER and DELETE database objects such as schema, tables, view, sequence etc. Data manipulation language (DML) - Data manipulation language makes user able to access and manipulate data. It is used to perform following operations. Insert data into database Retrieve data from the database Update data in the database Delete data from the database Data control language (DCL) - Data control

Basic Terminology

What is scripting language? A scripting language is a programming language that supports scripts programs written for a special run time environment that can interpret (rather than compile) automates and executes the tasks that could be alternatively executed by human operator. What is static Web pages? A static web page is the web page that delivered to user exactly as stored in contrast to dynamic web pages which are generated by a web application. What is Dynamic Web Pages?   A server side dynamic web page is controlled by an application server processing server side scripting. What is web server? Web server is the software used to run web application, Main functionality of server is to handle the request from the client and send response to client. What is web browser? The web browser is the software used to open the web application from the web server. Web browser can also execute HTML, Java Script, CSS and other client side script. What is

Introduction To PHP

PHP stands for Highpertext Preprocessor. PHP is a widely used open-source scripting language. PHP is web technology implemented by Rasmus Lerdorf in 1995. PHP is implemented using C & Perl software. PHP is a server-side scripting language used in implementing dynamic web pages. PHP is maintained by Zend Organization. What is PHP? PHP is basically server-side scripting language which is basically used for developing dynamic web pages. Why PHP? PHP code can run on any platform like windows, mac, linux etc. PHP is computable with all the web servers used today. PHP supports wide range of databases. PHP is easy to learn and it is freely available.