Most viewed questions in PHP

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,184 views
0 votes
1 answer

How to remove new lines and returns from php string?

Hello @kartik, You need to place the \n in double ...READ MORE

Nov 19, 2020 in PHP by Niroj
• 82,880 points
12,775 views
0 votes
1 answer

How to call a php function from ajax?

Hello @kartik, You can't call a PHP function ...READ MORE

Jun 16, 2020 in PHP by Niroj
• 82,880 points
12,242 views
0 votes
0 answers

Mailer Error: SMTP connect() failed in php mailer( https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting)

Here is code for sending email from ...READ MORE

Jun 2, 2022 in PHP by Kichu
• 19,050 points
12,103 views
0 votes
1 answer

How to pass an array within a query string?

Hello, Submitting multi-value form fields, i.e. submitting arrays ...READ MORE

Apr 8, 2020 in PHP by Niroj
• 82,880 points
11,740 views
0 votes
1 answer

How to run composer from anywhere?

Since Composer works with the current working ...READ MORE

Oct 19, 2020 in PHP by Niroj
• 82,880 points
11,501 views
0 votes
1 answer

How to configure XAMPP to send mail from localhost?

Hello @kartik, You can send mail from localhost ...READ MORE

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

What is the use of the @ symbol in PHP?

Hello @kartik, The @ symbol is the error control operator ("silence" or "shut-up" ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,367 views
0 votes
1 answer

How can I get ID of the last updated row in MySQL?

Hello @kartik, Suppose, item_id is an integer identity column in items table ...READ MORE

Apr 9, 2020 in PHP by Niroj
• 82,880 points
11,320 views
0 votes
1 answer

How to check if the request is an AJAX request with PHP?

Hello @kartik, Try below code snippet if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) ...READ MORE

Oct 29, 2020 in PHP by Niroj
• 82,880 points
11,120 views
0 votes
1 answer

Error:Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF.

Hello @kartik, You're inserting values for OperationId that is an identity ...READ MORE

Jul 21, 2020 in PHP by Niroj
• 82,880 points
11,062 views
0 votes
1 answer

How to configuring a xampp web server for different root directory?

Hello @kartik, You can change Apaches httpd.conf by ...READ MORE

Oct 20, 2020 in PHP by Niroj
• 82,880 points
10,928 views
0 votes
1 answer

How to Execute php file from another php?

Hello @kartik, It's trying to run it as ...READ MORE

Nov 18, 2020 in PHP by Niroj
• 82,880 points
10,879 views
0 votes
1 answer

Error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 9

Hello @kartik, Replace TYPE=MyISAM with ENGINE=MyISAM The problem was "TYPE=MyISAM" which should ...READ MORE

Nov 16, 2020 in PHP by Niroj
• 82,880 points
10,864 views
0 votes
0 answers

Dropdown onchange using ajax

My form has a dropdown that I ...READ MORE

Jul 31, 2022 in PHP by Kithuzzz
• 38,010 points
10,736 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,701 views
0 votes
1 answer

How to remove all special characters from a string?

Hello @kartik, This should do what you're looking ...READ MORE

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

How to send email with PHPMailer - embed image in body?

Hello @kartik, I found the answer: $mail->AddEmbeddedImage('img/2u_cs_mini.jpg', 'logo_2u'); and on ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,880 points
10,478 views
0 votes
1 answer

How can I handle the warning of file_get_contents() function in PHP?

Hello @kartik, This is fairly simple: if (!$data = ...READ MORE

Apr 7, 2020 in PHP by Niroj
• 82,880 points
10,437 views
0 votes
0 answers

How to GET data from API and show it on PHP page?

I want to use some data from ...READ MORE

Jul 31, 2022 in PHP by Kithuzzz
• 38,010 points
10,369 views
0 votes
0 answers

PHP password validation

I made a registration validation in PHP. ...READ MORE

Jun 20, 2022 in PHP by narikkadan
• 63,420 points
10,244 views
0 votes
0 answers

How to call a PHP function on the click of a button

The two buttons on my functioncalling.php page ...READ MORE

Jul 24, 2022 in PHP by Kithuzzz
• 38,010 points
9,892 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,737 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

Aug 8, 2020 in PHP by anonymous
9,492 views
0 votes
0 answers

PHP Session Destroy on Log Out Button

I'm currently working on a website that ...READ MORE

Jul 26, 2022 in PHP by Kithuzzz
• 38,010 points
9,272 views
0 votes
1 answer

How to upload and delete files from dropzone.js?

Hello, For deleting thumbnails you have to enable ...READ MORE

Nov 4, 2020 in PHP by Niroj
• 82,880 points
9,266 views
0 votes
0 answers

phpmyadmin Failed to set session cookie. Maybe you are using HTTP instead of HTTPS

I successfully installed PHP, Apache, and MySQL. ...READ MORE

Jul 28, 2022 in PHP by Kithuzzz
• 38,010 points
9,193 views
0 votes
1 answer

How can I ping a server port with PHP?

Hello, Try this : echo exec('ping -n 1 -w ...READ MORE

Nov 22, 2020 in PHP by Niroj
• 82,880 points
9,182 views
0 votes
1 answer

How can I use break or continue within for loop in Twig template?

Hello @kartik, This can be nearly done by setting a ...READ MORE

Oct 22, 2020 in PHP by Niroj
• 82,880 points
9,175 views
0 votes
0 answers

How can I access http://localhost/wordpress/wp-admin/install.php?

WordPress is running on localhost for me ...READ MORE

Aug 6, 2022 in PHP by Kithuzzz
• 38,010 points
9,143 views
0 votes
1 answer

How to order results with findBy() in Doctrine

Hii @kartik, Try out this code $ens = $em->getRepository('AcmeBinBundle:Marks')               ...READ MORE

Apr 20, 2020 in PHP by Niroj
• 82,880 points
9,136 views
0 votes
1 answer

How to upload and Save Files with Desired name using php?

Hello, You can try this, $info = pathinfo($_FILES['userFile']['name']); $ext = ...READ MORE

Nov 4, 2020 in PHP by anonymous
• 82,880 points
8,921 views
0 votes
0 answers

localhost/phpmyadmin is not working when i am trying to open using admin button in xampp dashboard but working in some other way

The phpmyadmin console is not opening when ...READ MORE

May 29, 2022 in PHP by Kichu
• 19,050 points
8,846 views
0 votes
1 answer

How to print all session variables currently set?

Hello @kartik, Use this: echo '<pre>'; var_dump($_SESSION); echo '</pre>'; Or you can ...READ MORE

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

How do check if a PHP session is empty?

Hii, I would use isset and empty: session_start(); if(isset($_SESSION['blah']) && !empty($_SESSION['blah'])) { ...READ MORE

Nov 9, 2020 in PHP by Niroj
• 82,880 points
8,727 views
0 votes
1 answer

How can I use PHP to check if a directory is empty?

Hello @kartik, It seems that you need scandir instead of ...READ MORE

Nov 10, 2020 in PHP by Niroj
• 82,880 points
8,706 views
0 votes
0 answers

PHP file_get_contents() returns "failed to open stream: HTTP request failed!"

I'm having trouble using PHP code to ...READ MORE

Jul 28, 2022 in PHP by Kithuzzz
• 38,010 points
8,657 views
0 votes
0 answers

phpMyAdmin access denied for user 'root'@'localhost' (using password: NO)

I am having this error when I ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,050 points
8,343 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,285 views
0 votes
1 answer

Error: The mbstring extension is missing. Please check your PHP configuration

Hii, Edit the php.ini file: change extension_dir = "ext" into extension_dir = "D:\php\ext" (please write ...READ MORE

Oct 30, 2020 in PHP by Niroj
• 82,880 points
8,203 views
0 votes
1 answer

How foreach change original array values in php?

Hello @kartik, Do the following: foreach ($fields as $key ...READ MORE

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

How to convert multidimensional array into single array?

Hello, This single line would do that: $array = ...READ MORE

Nov 6, 2020 in PHP by Niroj
• 82,880 points
8,011 views
0 votes
1 answer

How do you Encrypt and Decrypt a PHP String?

Hello @kartik, Use openssl_encrypt and openssl_decrypt You can do something like: $string_to_encrypt="Test"; $password="password"; $encrypted_string=openssl_encrypt($string_to_encrypt,"AES-128-ECB",$password); $decrypted_string=openssl_decrypt($encrypted_string,"AES-128-ECB",$password); Hope it ...READ MORE

Sep 14, 2020 in PHP by Niroj
• 82,880 points
7,927 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,793 views
0 votes
1 answer

How to delete all cookies of my website in php?

Hello @kartik, This will unset all of the ...READ MORE

Oct 27, 2020 in PHP by Niroj
• 82,880 points
7,782 views
0 votes
1 answer

How do I get the HTML code of a web page in PHP?

Hello @kartik, If your PHP server allows url ...READ MORE

Oct 6, 2020 in PHP by Niroj
• 82,880 points
7,659 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,483 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,468 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,457 views
0 votes
1 answer

How to get the base domain/url in php?

Hello @kartik, Use SERVER_NAME. echo $_SERVER['SERVER_NAME'] ...READ MORE

Nov 3, 2020 in PHP by Niroj
• 82,880 points
7,438 views