$_SERVER['REMOTE_ADDR'] id use to get the IP address of the user.   But sometime it may not return the true IP address of the client at all time. Use Below code to get true IP …

Last updated 8 years, 2 months ago | 3040 views

Tags:- PHP

Django | Overriding the save method The save method is inherited from models.Model class. It is used to override the save method before storing the data in the database. This is used when there is …

Last updated 5 years, 9 months ago | 3031 views

Tags:- Django

PHP | Output of the following statements var_dump(0123 == 123); var_dump('0123' == 123); var_dump('0123' === 123   var_dump(0123 == 123) This will output bool(false) because the leading 0 in 0123 tells the PHP interpreter to treat the …

Last updated 7 years, 1 month ago | 3029 views

Tags:- PHP

SQL | Foreign Key A foreign key is a key used to link two tables.    A Primary key of a table is used as a foreign key for the other table. The primary key …

Last updated 7 years, 5 months ago | 3022 views

Tags:- SQL MySQL

PHP | Variable A variable is a user define keyword which is used to store value like string, number, and array. Once a variable is defined then we can use it one or more than …

Last updated 8 years, 2 months ago | 2998 views

Tags:- PHP

PHP | Comments A comment in PHP code is a line that is not executed as a part of the program. It's only read by someone who is looking at the code. By reading the comments …

Last updated 7 years, 1 month ago | 2977 views

Tags:- PHP

PHP | isset() The isset () function is used to check whether a variable is set or not. It returns true if a variable is set otherwise it returns false.   <?php $var = "StudyZone4U.com"; …

Last updated 7 years, 6 months ago | 2968 views

Tags:- PHP

SSH | Export and Import Large Database OR Table Using SSH can be a good practice to manage the files and databases on your account. It is most important to use in the following circumstance …

Last updated 7 years, 6 months ago | 2951 views

Tags:- MySQL SSH

PHP | Converting array of objects to array Array of objects look like this: Array ( [0] => stdClass Object ( [id] => 1 [name] => Ram [roll] => 12 ) [1] => stdClass Object ( …

Last updated 7 years, 6 months ago | 2936 views

Tags:- PHP

Codeigniter | routes  Routing rules are defined in your application/config/routes.php file.    In it, you'll see an array called $route that permits you to specify your own routing criteria. Routes can either be specified using …

Last updated 7 years, 3 months ago | 2917 views

Tags:- CodeIgniter

Constant in PHP The define() function is used to defining a constant in PHP define("GREETING", "Welcome to StudyZone4U.com");   Constants are like variables except that once they are defined they cannot be changed or undefined …

Last updated 7 years, 6 months ago | 2914 views

Tags:- PHP

PHP | Redirect PHP header() function is used to redirect a page to another page. It supplies raw HTTP headers to the browser and redirects it to another location. The redirection script should be at …

Last updated 7 years, 6 months ago | 2899 views

Tags:- PHP

SQL Update statement The UPDATE statement is used to update the records of an existing table in a database. We can update single as well as multiple columns using SQL update statement. The basic syntax …

Last updated 7 years, 8 months ago | 2898 views

Tags:- SQL MySQL

PHP | Web Scraping Web scraping is used to get specific data from another website when there is no API available for it. There are many techniques for web scraping. You can read more about this …

Last updated 6 years, 7 months ago | 2895 views

Tags:- PHP

MySQL | Find last insert id in the table By using the MySQL function mysqli_insert_id() we can retrieve the last inserted id in the database table.   <?php $con = mysqli_connect("localhost","user_name","user_password","db_name"); if (mysqli_connect_errno()) { echo …

Last updated 7 years, 6 months ago | 2892 views

Tags:- PHP PHP-MySQL