Latest questions in PHP

–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,818 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,247 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
634 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,206 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
817 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,156 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,169 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,499 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,193 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,272 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,582 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,472 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
835 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,456 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
908 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,933 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
621 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
1,008 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,142 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,608 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,715 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
786 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
33,285 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,962 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
805 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,648 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,847 views
0 votes
2 answers

Error:SMTP server response: 530 SMTP authentication is required.

Yes good i like it so nice ...READ MORE

Aug 25, 2020 in PHP by Mani Usman
3,624 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,233 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,766 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,568 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,243 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,311 views
+1 vote
1 answer

ERROR: Cannot add or update a child row: a foreign key constraint fails

Hello @kartik, You are getting this constraint check ...READ MORE

Aug 20, 2020 in PHP by Niroj
• 82,880 points
29,432 views
+1 vote
1 answer

How to restore MySQL database from physical files?

Hello @kartik, A MySQL MyISAM table is the ...READ MORE

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

How do I find out my MySQL URL, host, port and username?

Hello @kartik, If you're already logged into the ...READ MORE

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

How can I connect to MySQL in Python 3 on Windows?

Hello @kartik, You should probably use pymysql - Pure Python ...READ MORE

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

How to convert a string to date in mysql?

Hello @kartik, you can do SELECT STR_TO_DATE(yourdatefield, '%m/%d/%Y') FROM ...READ MORE

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

How to get all columns' names for all the tables in MySQL?

Hello @kartik, Try this: select * from information_schema.columns where table_schema ...READ MORE

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

How to Import SQL file into mysql?

Hello @kartik, From the mysql console: mysql> use DATABASE_NAME; mysql> ...READ MORE

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

How to check if a string is JSON or not?

Hello @kartik, Use JSON.parse function isJson(str) { ...READ MORE

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

How to convert timestamp to date in MySQL query?

Hello @kartik, Try this: DATE_FORMAT(FROM_UNIXTIME(`user.registration`), '%e %b %Y') AS ...READ MORE

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

Error: Can't connect to MySQL server on 'my.application.com' (10061)

Hello @kartik, To directly login to a remote ...READ MORE

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

How to remove MySQL root password?

Hello @kartik, You need to set the password ...READ MORE

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

How to alter a MySQL column to be AUTO_INCREMENT?

Hello @kartik, Try this: ALTER TABLE document MODIFY COLUMN ...READ MORE

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

Error:MySQL Update Inner Join tables query

Hello @kartik, Try this: UPDATE business AS b INNER JOIN ...READ MORE

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

Error:Cannot connect to database server Communications link failure

Hello @kartik, Setting the bind-address to the server's network IP ...READ MORE

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

How to move columns in a MySQL table?

Hello @kartik, If empName is a VARCHAR(50) column: ALTER ...READ MORE

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

How to see indexes for a database or table in MySQL?

Hello @kartik, To see the index for a ...READ MORE

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

How to export the MySql database structure without the data just the structure?

Hello @kartik, You can do with the --no-data option with ...READ MORE

Aug 18, 2020 in PHP by Niroj
• 82,880 points
2,272 views