Most answered questions in PHP

0 votes
1 answer

Error:PDOException could not find driver

Hello @kartik, You need to have a module ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
13,616 views
0 votes
1 answer

How do I use the json_encode() function with MySQL query results?

Hello @kartik, Use this: $sth = mysqli_query($conn, "SELECT ..."); $rows ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
3,359 views
0 votes
1 answer

How I can make a query with MySQL that checks if the valuein a certain column contains certain data?

Hello @kartik, Try this query: mysql_query(" SELECT * FROM `table` WHERE `column` ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
2,819 views
0 votes
1 answer

How to delete all files from a folder using PHP?

Hello @kartik, Use this: $files = glob('path/to/temp/*'); // get ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
1,123 views
0 votes
1 answer

Notice: Undefined index: bid in C:\xampp\htdocs\userac\courier_management_system-master\courier_management_system-master\addstaff.php on line 130

Hello @saima , Before you extract values from $_POST ,$_SESSION, ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
2,583 views
0 votes
1 answer

How to increase the execution timeout in php?

Hello @kartik, You need to change some setting ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
990 views
0 votes
1 answer

How to get file_get_contents() to work with HTTPS?

Hello @kartik, Try the following script to see ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
4,480 views
0 votes
1 answer

Error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140

Hello @kartik, Go to: xampp\phpMyAdmin\libraries\config.default.php Look for : $cfg['ExecTimeLimit'] = 600; You ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
13,860 views
0 votes
1 answer

How to get original URL referer with PHP?

Hello @kartik, Store it either in a cookie or ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
16,975 views
0 votes
1 answer

Error:Internal server errordisplay in PHP via htaccess only

Hello @kartik,  Try adding this line .htaccess: php_flag display_startup_errors ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
649 views
0 votes
1 answer

Error:Got a packet bigger than 'max_allowed_packet'bytes

Hello @kartik, max_allowed_packet is set in mysql config, not ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
4,667 views
0 votes
1 answer

How to get current URL path in PHP?

Hello @kartik, Use $_SERVER['REQUEST_URI'].  The URI which was given in ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
3,713 views
0 votes
1 answer

How to get Root Directory Path of a PHP project?

Hello @kartik, Try $_SERVER['DOCUMENT_ROOT'] contains this path: D:/workspace In that case you ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
22,242 views
0 votes
1 answer

How to store values from foreach loop into an array?

Hello @kartik, Declare the $items array outside the loop and ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
28,774 views
0 votes
1 answer

How to pass arrays as url parameter?

Hello @kartik, There is a very simple solution: http_build_query(). ...READ MORE

Sep 1, 2020 in PHP by Niroj
• 82,880 points
5,834 views
0 votes
1 answer

How do I check whether a checkbox is checked in jQuery?

Hello @kartik, The checked property of a checkbox DOM element ...READ MORE

Aug 28, 2020 in PHP by Niroj
• 82,880 points
587 views
0 votes
1 answer

How can I remove a specific item from an array?

Hello @kartik, Find the index of the array element you ...READ MORE

Aug 28, 2020 in PHP by Niroj
• 82,880 points
444 views
0 votes
1 answer

How to get current PHP page name?

Hello @kartik, You can use basename() and $_SERVER['PHP_SELF'] to get current page ...READ MORE

Aug 28, 2020 in PHP by Niroj
• 82,880 points
2,631 views
–1 vote
1 answer

Error:Notice: Array to string conversion in C:\xampp\htdocs\Niroj\FinalSubmissionOfTheFormPHP.php on line 8

Hello @kartik, When you have many HTML inputs ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
9,793 views
0 votes
1 answer

How can I use jquery $.ajax to call a PHP function?

Hello @kartik, Use $.ajax to call a server context (or ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
14,171 views
0 votes
1 answer

How can I upload Multiple file in php?

Hello @kartik, Multiple files can be selected and ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
615 views
0 votes
1 answer

How to get name of current directory using php?

Hello @kartik, To get only the name of ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
4,169 views
0 votes
1 answer

How to convert JSON string to array?

Hello @kartik, If you pass the JSON in ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
807 views
0 votes
1 answer

How to make PDF file downloadable in HTML link?

Hello @kartik, Try this: <a href="./directory/yourfile.pdf" download="newfilename">Download the pdf</a> Where newfilename is ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
19,054 views
0 votes
1 answer

How can I disable XDebug using php?

Hello @kartik, Find your php.ini and look for XDebug. Set xdebug ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
4,142 views
0 votes
1 answer

How to call function of one php file from another php file and pass parameters to it?

Hello @kartik, Include the first file into the ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
24,365 views
0 votes
1 answer

How can I compare two dates in PHP?

Hello @kartik, If all your dates are posterior ...READ MORE

Aug 27, 2020 in PHP by Niroj
• 82,880 points
1,165 views
0 votes
1 answer

How to grant remote access permissions to mysql server for user?

Hello @kartik, This grants root access with the ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
4,218 views
0 votes
1 answer

How MySQL date format DD/MM/YYYY select query?

Hello @kartik, You can use STR_TO_DATE() to convert your strings ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
7,538 views
0 votes
1 answer

How to delete from multiple tables in MySQL?

Hello @kartik, Use a JOIN in the DELETE statement. DELETE p, pa ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
3,448 views
0 votes
1 answer

How to update column with null value?

Hello @kartik, CREATE TABLE your_table (some_id int, your_column ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
813 views
0 votes
1 answer

How to delete a certain row from mysql table with same column values?

Hello @kartik, Add a limit to the delete query delete from orders where ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
1,438 views
0 votes
1 answer

How to delete duplicates on a MySQL table?

Hello @kartik, This removes duplicates in place, without ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
880 views
0 votes
1 answer

How to find out the MySQL root password

Hello @kartik, Follow these steps to reset password ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
7,875 views
0 votes
1 answer

How to get database structure in MySQL via query

Hello @kartik, Use this: DESCRIBE table; You can also use SHOW ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
602 views
0 votes
1 answer

How to create a database from shell command?

Hello @kartik, Try: cat filename.sql | mysql -u username ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
989 views
0 votes
1 answer

How do I import an SQL file using the command line in MySQL?

Hello @kartik, Try: mysql -u username -p database_name < ...READ MORE

Aug 26, 2020 in PHP by Niroj
• 82,880 points
1,129 views
0 votes
1 answer

How to post data in PHP using file_get_contents?

Hello @kartik, Sending an HTTP POST request using file_get_contents is ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
6,575 views
0 votes
1 answer

How can I use Sockets.io on the client side and communicate with a PHP based application on the server?

Hello @kartik, For 'long-lived connection' , you can ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
2,698 views
0 votes
1 answer

How to print a debug log?

Hello @kartik, A lesser known trick is that ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
774 views
0 votes
1 answer

How to resolve the problem of losing a session after a redirect in PHP?

Hello @kartik, Carry out these usual checks: Make sure session_start(); is ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
32,867 views
0 votes
1 answer

How to disable registration new users in Laravel?

Hello @kartik, Laravel 5.7 introduced the following functionality: Auth::routes(['register' ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
1,943 views
0 votes
1 answer

How do I recursively delete a directory and its entire contents files as well as sub dirs in PHP?

Hello @kartik, The user-contributed section in the manual ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
796 views
0 votes
1 answer

How to zip a whole folder using PHP?

Hello @kartik, You can Zip a whole folder using ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
7,570 views
0 votes
1 answer

How to access class constants in Twig?

Hello @kartik, Try this: {% if var == constant('Namespace\\Entity::TYPE_PERSON') ...READ MORE

Aug 24, 2020 in PHP by Niroj
• 82,880 points
2,816 views
0 votes
1 answer

Error:Unknown column in 'field list' error on MySQL Update query

Hello @kartik, Enclose any string to be passed ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
13,212 views
0 votes
1 answer

How to convert PHP code to MySQL query to CSV?

Hello @kartik, Try this: SELECT * INTO OUTFILE "c:/mydata.csv" FIELDS ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
2,743 views
0 votes
1 answer

How to save MySQL query output to excel or .txt file?

Hello @kartik, You can write following codes to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
3,534 views
0 votes
1 answer

How can I access the MySQL command line with XAMPP for Windows?

Hello @kartik, Your MySQL binaries should be somewhere ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
20,129 views
0 votes
1 answer

How to execute a MySQL command from a shell script?

Hello @kartik, You need to use the -p flag to ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
3,295 views