Questions tagged [php]

Use ONLY if PHP is directly relevant to the question and likely to be the source of your problem, not just because you're using a PHP library to connect to a database. PHP stands for Professional Hypertext Preprocessor, a widely used platform for dynamic web applications. If you have a general programming question about PHP, please ask it on Stack Overflow instead.

Use only if PHP is directly relevant to the question and likely to be the source of your problem, not just because you're using a PHP library to connect to a database.

PHP is a widely used web open-source web application platform, commonly used in conjunction with MySQL. Originally an abbreviation for 'Professional Home Page' the official backronym is now 'Professional Hypertext Preprocessor'. PHP is a key component of he eponymous 'LAMP' (Linux, Apache, MySQL PHP) web stack. The primary web site for PHP is http://www.php.net/.

If you have a question about PHP, and it's not intimately about databases, you would probably be better served on our sister site Stack Overflow.

666 questions
310
votes
12 answers

connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host

Hello I am trying to run a website sent to me but after doing so this error appeared connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "4X.XXX.XX.XXX", user "userXXX", database "dbXXX", SSL off in C:\xampp\htdocs\xmastool\index.php…
Jin
  • 3,213
  • 2
  • 11
  • 6
19
votes
1 answer

How to get rid of "maximum user connections" error?

I am using MySQLi for my webapp but whenever I want to visit some particular page, I get mysqli_connect() [function.mysqli-connect]: (42000/1203): User ***_user already has more than 'max_user_connections' active connections. I tried already to…
ahmed
  • 293
  • 1
  • 2
  • 4
12
votes
5 answers

importing large SQL file phpmyadmin

I am trying to import this SQL file in phpmyadmin and got this message #1064 - 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 '
Fatal error:…
grant tailor
  • 369
  • 2
  • 3
  • 7
12
votes
3 answers

How to use insert delay with the InnoDB engine and use less connection for insert statements?

I'm working on an application which involves a lot of database writes, approximately ~70% inserts and 30% reads. This ratio would also include updates which I consider to be one read and one write. Through insert statements multiple clients insert…
Shashank
  • 397
  • 4
  • 5
  • 15
11
votes
1 answer

PostgreSQL PREPARE query with IN () parameters

I'm trying to prepare a query from PHP like: pg_prepare($con, "prep", "select * from test where tid in ($1)"); and then execute it with: $strpar = "3,4,6,8,10"; pg_execute($con, "prep", array($strpars)); The problem is that I cannot pass a series…
Fabrizio Mazzoni
  • 1,880
  • 4
  • 20
  • 31
10
votes
1 answer

Deleting large amounts (4 million rows) of mysql data efficiently, on a very regular basis

We have a mysql table that at any given time has about 12 million rows. We need to delete old data to keep the size of the table somewhat manageable. Right now we are running this query daily, at midnight, using a cron job: DELETE FROM table WHERE…
user417669
10
votes
2 answers

Server requested authentication method unknown to the client [mysql_old_password]

Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client I get the error above while trying to connect…
Chibuzo
  • 265
  • 2
  • 4
  • 9
10
votes
1 answer

Calculate MATCH() AGAINST() scores from UNIFIED QUERY not FOR EACH TABLE

I am trying to have a score for entire section of SELECT statements SELECT *,MATCH(`result`) AGAINST('keyword') as `score` FROM `table1` WHERE MATCH(`result`) AGAINST('keyword') UNION SELECT *,MATCH(`content`) AGAINST('keyword') as `score` FROM…
dachints
  • 201
  • 1
  • 3
9
votes
3 answers

How to resolve too many connections and fatal error in mysql running on vps

I am running an application PHPlist on my linode server, simultaneously running 12 PHP scripts, each of which opens a MySQL connection. Now when I access PHPlist it often shows this error: Fatal Error: Sorry, the server is currently too busy,…
Shashank
  • 397
  • 4
  • 5
  • 15
8
votes
1 answer

Application Settings in Database

In the past I have stored all generic settings and configuration items such as: custom application title, home address, version, debug, etc.. all in a "settings.php" file that I would include into all of my scripts. I would assume that it is better…
CenterOrbit
  • 440
  • 3
  • 10
8
votes
1 answer

What does it mean that PostgreSQL "offers" PHP?

On https://www.enterprisedb.com/downloads/postgres-postgresql-downloads : PostgreSQL runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, macOS, Solaris), and Windows. It offers the following programming languages: PL/pgSQL,…
8
votes
2 answers

How to create recurrent weekdays as columns in a pivot?

I am newcomer to programming and databases and I would be grateful for some help on the following scenario. I use PHP with SQL Server. I am building an employee attendance system and I would like to create a (pivot) table with months as rows and all…
Mike T
  • 95
  • 5
7
votes
3 answers

Implementing soft delete

Could someone please show or describe to me how to implement soft deletes? I have table of vouchers with these fields: id, username, password, serial. I want to display a given number of rows depending on the customer's request and once displayed…
Ruyonga Dan
  • 173
  • 1
  • 1
  • 4
7
votes
2 answers

MySQL connection doesn't work anymore

I had two MySQL servers running (127.0.0.1:3306 and 127.0.0.1:3307). Now I get this strange error: mysql_connect(): Lost connection to MySQL server at 'reading initial communication packet' I can connect with localhost:3307, but there aren't any…
Kevin
6
votes
3 answers

Database design to track student attendance

I was having a doubt regarding the design of a database table to track students' attendance. Currently, my table students have atleast 4000 students. Creating a database for attendance to track their attendance will have almost 4000*30days*12months…
xan
  • 161
  • 1
  • 1
  • 4
1
2 3
44 45