Insert to database when button is click

I have a button when click it will insert the statement to the database however even without clicking the button the insert statement is already run .why? <?php header('P3P: CP="NOI ADM DEV PSAi...

PDO MySQL: Use PDO::ATTR_EMULATE_PREPARES or not?

This is what I've read so far about PDO::ATTR_EMULATE_PREPARES: PDO's prepare emulation is better for performance since MySQL's native prepare bypasses the query cache. MySQL's native prepare is...

PHP Commands Out of Sync error

I am using two prepared statements in PHP/MySQLi to retrieve data from a mysql database. However, when I run the statements, I get the "Commands out of sync, you can't run the command now"...

Why is mysqli_insert_id() always returning 0?

I have the following code. The mysqli_insert_id() (in this case "$last_row"), which is supposed to return the last row of the table, is always returning 0. Why is it...

how to save the data that the user input in form page after the script executed?

may I know is it possible to save the data from the form which the user input earlier? Here is the form file: <!DOCTYPE HTML> <html> <head> <meta http-equiv="content-type"...

How Will Joomla work with MariaDB?

I am already have WAMP stack in my system and I am using Joomla based system. To test MariaDB before using, I installed MariaDB also in my system with Port number 3305. Now, when I try to install...

How to generate new random value if it already exists in the database?

How to automatically generate new random value in textbox if the value already exists in the database? An example of my attempt: <?php $length = 1; $randomString = substr(str_shuffle("123456789"),...

How to see functions' parameters and descriptions on Sublime Text 3?

I see it on Notepad++ in advance (Ctrl+Shift+Space), but I dont find functions' parameters. I need PHP, MySQLi etc functions' descriptions or parameters tip. I need something similar to this:

Fatal error: Call to undefined function mysqli_connect()

For 2 days now I'm trying to solve this, but unfortunately no result. Let me tell you my story about the problem. I've bulid an application on a site, and the application deals with the reviews....

How to select values where another value is an array?

I'm trying to select values where another POST values are an array, I do not know what is wrong with my query giving me this error. I'm trying to know what courses are just added to table. I have...

Getting error mysqli::real_connect(): (HY000/2002): No such file or directory when I try to access my project on live server

I had uploaded my website to server and then I tried to access, but the code igniter returns me that error that I don't find any answer. Why is this happening? My config database is set...

Mysqli Commands out of sync

I'm getting the following error: "Commands out of sync; you can't run this command now" On this code: $check = $dbc->prepare("SELECT field FROM table WHERE field =...

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /private/tmp/wordpress/wp-includes/wp-db.php on line 1452

I'm trying to run PHPUnit to unittest a WordPress plugin, but the error in the title keeps showing up. I used WP-CLI to setup the unittests, but also WP-CLI throws a similar error when I try to...

Codeigniter 3 Fatal error: Call to a member function database() on null

I think that can't manage to connect to the database and I don't know why. I have looked over stackoverflow and found this questions: here and it is not helping me in solving my problem. I have...

sum(value) gives undefined index

I'm having trouble calculating the sum of one column in the database from the first 5 rows. My code is: $mysqli=mysqli_connect($host,$user,$password,$database); $sql = "SELECT SUM(medie) FROM...

Updating an image and text at the same time in Php and Mysql

Users can add, edit and delete content on my web page. People can edit the text and the image they upload. However, the image will not display if I only edit the text. When I edit the text but not...

HY000 2006 MySQL server has gone away

So, I saw that there is a lot of questions about this problem, but i couldn't find any solution. I try in PHP to connecto to my database on hosting server but I get this: [HY000] [2006] MySQL...

phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO)

I keep getting the following errors with mysql connection through XAMPP and I don't know what to do: That's the code in the config.inc.php <?php /* * This is needed for cookie based...

Docker-php-ext-install mcrypt missing folder

I try to install mcrypt in my docker image based on php:7.2-apache. Therefore I use the RUN-Command from the documentation and also answerd here but I receive this error: error:...

Unable to insert a record in a table in php mysql

I am unable to insert the record in a table and even not getting any error but when I am trying to create a table with the same method the query is executing correctly. I stuck with this problem...

Missing PHP extension zip when trying to install laravel from composer

I have seen this question answered on other posts here, but none of the answers work for me. Mostly because I'm trying to install laravel locally on my mac and the answers are for Linux...

Docker: PhpMyAdmin has an upload limit of 2048KiB

i have a docker-compose.yml that looks like this: webserver: build: ./_docker/php ports: - 80:80 links: - mysql volumes_from: - app mysql: image: mysql:5.7 environment: ...

WP database error Unknowon column ‘wp_’ in ‘field list’ for query SELECT wp_

Please do not close this question, it's not a duplicate and the suggested link explaining how to use quotes on MySQL does nothing for me since this problem is inside a WP script. Thanks I’m...

SQLSTATE[HY000] [2002] Connection refused on laravel and docker setup

I am trying to set up a docker environment for laravel development. I am facing issues with the migrate command. I am pasting her the compose file and env file. I think my settings are correct...

Alpine 3.8 Docker image: Enabling SSL on libmongoc

I am currently building a base image for my project. The project is using mongodb. I've successfully created the image but an error shows up when I try to call the endpoint which is related with...

Why when I start phpmyadmim this writting appears?

I start on Xammp Apache and MySQL but when I click on admin instead of opening the phpmyadmin page I see this writing: Composer detected issues in your platform: Your Composer dependencies require...

.gitlab-ci.yml - wordpress service wait for db

I want to do some automatic testing with WordPress in GitLab CI. test: image: alpine stage: test tags: - docker services: - alias: db name: mysql:5.7 - alias: wp ...

Error: "Call to undefined method CodeIgniter\Database\MySQLi\Connection::select()"

I am struggling to solve this error and didn't understand it. Model: public function join() { $db = \Config\Database::connect(); $session = \Config\Services::session(); $id =...

Unknown column 'wp_' in 'field list' when running WordPress on PHP 8.1

Is it possible to run Wordpress on PHP 8.1 right now? I have installed PHP 8.1 in XAMPP, but I can't get Wordpress to work. I get this error message: [23-Nov-2021 18:44:43 UTC] PHP Fatal error: ...

Very slow loop PHP

I'm a junior dev and i have a problem with a script's loop. The loop cycles large array came from the DB. The problem is complete the loop in shortest time is possible, but for now, about 500...