how many ways we can retrieve the data in the result set of MySQL using PHP?
PHP-MYSQL | Fetch Recoards From MySql table There are 4 ways: mysqli_fetch_row() - Get a result row as an enumerated array mysqli_fetch_array() - Fetch a result row as an associative array, a numeric array, or both mysqli_fetch_object() …
Give an example of Transaction with commit and rollback?
PHP-MySQL | Transaction with commit and rollback try { // First of all, let's begin a transaction $db->beginTransaction(); // A set of queries; if one fails, an exception should be thrown which we are handling at …
What is the best collation to use for MySQL?
MySQL | What is the best collation to use for MySQL? Mostly we use: utf8_general_ci utf8_unicode_ci utf8_general_ci is used for fast sorting but it is less accurate whereas utf8_unicode_ci is used for better accuracy but …
What are the 3 different ways in PHP to connect with MySQL?
The three different way in PHP to connect with MySQL is: MySQL MySQLI PDO Note: We should use MySQLI because MySQLI is imporoved version of MySQL and have more function then MySQL.
How can we get the current session id in PHP?
session_id() function There is a function session_id() in php which is use to get and/or set the current session id. string session_id ([ string $id ] ) for getting session id in php we have to …
What are default session time in PHP?
PHP | What are default session times in PHP? By default, session variables last until the user closes the browser or leaves the site otherwise most of the server terminates the session variable if you …
How to remove HTML tags from a string in PHP?
PHP | strip_tags() function strip_tags() function is use to remove HTML, XML, and PHP tags from string. The function provides you the ability to remove tags from strings. You can also ignore certain tags by …
Unset function in PHP
PHP | unset() function The function unset() is an inbuilt function in in php which is use to delete variable. unset($var) or void unset ( mixed $var [, mixed $... ] ) Note: we can …
Unlink Function in PHP
PHP | Unlink() function The unlink() function is an inbuilt function in PHP that is used to delete the file from a directory. If the file function executes successfully and deletes the file then it …
What are the difference between Notify url and Return url?
PayPal | Notify url and Return url Both of these are used in PayPal payment gateway integration. Notify url is used by paypal to send response regarding current transaction in other word notify about the …
What is the difference between unlink and unset function?
unlink() and unset() The unlink() and unset() function in php have same functionality (i.e.: delete) but the difference is in the type of data on which they are applied to perform such delete functionalities. unlink() …
Why JQuery Ajax is sending GET instead of POST
JQuery | Ajax is sending GET instead of POST It's a very common problem which is faced by most of the new programer. In Ajax code, new learners use (type: "POST") yet the sending request went …
What type of inheritance supported by php?
PHP | Inheritance PHP mainly supports two types of inheritance: Single inheritance Multilevel inheritance
Adding element in an array in php
PHP | array_push() function We can add elements to an array in an easy way. There is an inbuilt function array_push() in PHP which is used to add elements to the PHP array. With the …
Save a generated PDF file using php
PHP | Download pdf file To download a pdf file in PHP, we need to use the header() function. In the header() function, we need to pass "Content-Disposition" which is used to supply a recommended filename …