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.

Filter by
Sorted by
Tagged with
1
vote
0answers
14 views

What All Is Factored Into A MySQL Checksum? (Why Could They Be Different?)

I'm currently going through the excruciating task of moving MySQL databases from one shared web hosting environment to another. This has been a multi-month battle (and I'm learning a lot). After ...
0
votes
1answer
10 views

Can't delete Xampp from my laptop (windows 7) [on hold]

I want to delete xampp from my laptop but its showing as I have mentioned below: the action can't be completed because the folder or a file in it is open in another program. close the folder and try ...
-1
votes
2answers
185 views

Optimal way(performance wise) to store array like data in MySQL [closed]

I am working on a website(PHP), and one of the features that the site should have is ordering items from the website, and the order will be like an array with an architecture similar to this: order( ...
-1
votes
1answer
298 views

Extremely slow website, MySQLTuner log, any advice?

We are running a Wordpress site and are having major problems with extremely slow response time for pages that have to miss the Nginx cache. I'm looking at our database performance as a culprit, and ...
0
votes
1answer
25 views

PDO returning 0 rows on WHERE with enum

I am trying to build a query for a report. The report will have a few fields that can be filtered, one of which is a jobStatus field, it is an enum. Here is my query SELECT * FROM jobs j LEFT JOIN ...
0
votes
0answers
14 views

How to apply a condition based on values of a particular ID in a table?

I have a feedback table with FeedbackID. I have an action table with ActionID and FeedbackID and Follow-up. This implies that a particular FeedbackID can be related to several ActionID. In action ...
-1
votes
1answer
194 views

How to find the most common phrases in a MySQL database

I have a table which contains articles on movies. Each article has a title and many of them have common phrases in them. I would like to do some analysis on the data and extract these common phrases ...
-1
votes
0answers
23 views

multiple types of info display from mysql db [migrated]

I have received great help and direction here recently so I'm back! The project is gathering a list of available care facilities and have the user be able to search the dB. So, i have the ...
0
votes
1answer
165 views

MySQL Query logic for filters for wordpress site

I'm a WordPress (PHP) developer, however I have not done a lot of complex MySQL queries. I am working on an events website and want to create filters: User should be able to filter events by the ...
0
votes
1answer
229 views

Tracking MongoDB execution times using PHP

I am currently working on a project using PHP, I have done research and found that microtime() helps with tracking the time of a query in a MySQL database.. how do I do the same for MongoDB, I have ...
182
votes
13answers
447k views

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 "...
1
vote
3answers
2k views

How to select different format of the date in mysql

I have this table and I can't change its format to yyyy-mm-dd because I have so many scripts that are related to this format dd-mm-yyyy. It would be a mess if I change its format. Id date ...
0
votes
1answer
40 views

Count up numbers from a specific column [closed]

Hi there was wondering if someone could help me out, and can give me a little code example. i have a table named "projecten", and columns named "pstatus and pafgifte" these columns have numbers only. ...
3
votes
2answers
941 views

MySQL Stored Procedure not throwing error if it contains a query that succeeds

I am writing a simple MySQL Stored Procedure, and calling it from PHP using PDO. This is just simple enough to illustrate the problem I'm having. This procedure test_procedure_2, does not throw any ...
0
votes
1answer
363 views

Optimising Marksheet Database [closed]

I am trying to design a database for mark sheet data of a school having different types of exams of different levels or class. Is it possible to have single table where I can store data in string (...
0
votes
1answer
365 views

sybase errors - meaning and resolution

We have a server that connects to 40+ different remote computers which are running Sybase 11.0.1.2596. Our server is hosted on an aws ec2 AMI Linux instance, and the connections are set up using ...
0
votes
1answer
16 views

Azure database - unable to locate in my Azure account

I have an Azure account where a developer that used to work with me has set up an MSSQL database on an Ubuntu VM. The PHP (CodeIgniter) system I am working on logs in (so database queries work ...
0
votes
0answers
25 views

Aborted connections (Erros reading communication packets)

I set up a new Database Server over a SQL Dump with innoDB MYSQL 5.7 from MYSQL 5.6. The Server running external with many sleeping SMTP connections over 1 Mio a day. I made the server open for ...
1
vote
1answer
419 views

MySQL / MyISAM: Queries sometimes very slow, no waiting for lock time

I have a web application using PHP 7.0 and MySQL 5.5.54-0+deb8u1-log. Occasionally, there are long waiting times in the application, which seem to be related to slow database queries. In the slow ...
0
votes
2answers
564 views

mysql - best way to provide unique voucher

I am designing a website that will provide vouchers (serial codes). All voucher codes generated and saved in a table like this and not generated online: v_id voucher ...
0
votes
1answer
1k views

PDO Select all tables who are beginning with a prefix

I have a lot of tables in my database and some of them are beginning with a prefix "amb_" egsample: "amb_users", "amb_locations" "amb_friends" etc Any Idea how to select all tables who are ...
0
votes
1answer
31 views

Performance MySQL query with for loop

In this method, first I have to get sundays dates between two dates, in this case about 1 year. Then I go through the dates in a for loop and set them to the query. I use prepared statements to make ...
0
votes
2answers
153 views

Generate invoice number from 0 to so on for ordered products in orders table in php mysqli

I am trying to generate invoice number in orders table, like if user select 1 or multiple products and add it to cart then place order then invoice number should be same in our orders table for that 1 ...
0
votes
1answer
555 views

MySQL MyISAM REPAIR TABLE lost connection to MySQL server during query

So I've been building up over time a database, and unfortunately I was using MyISAM which didn't have any problems until the database became huge. After massive CPU spikes, I created a script to ...
1
vote
2answers
4k views

MySQL: SELECT GET_LOCK slow/timeout

I am using "Zebra Session" as a replacement for PHP's built-in session management. Zebra Session stores sessions in a MySQL database, and uses "session locking" in order to ensure that data is ...
3
votes
1answer
1k views

PHP MySQLi Lock Tables Query Sometimes Does Not Complete

I am attempting to lock some tables while running some code and unlocking the tables when I am done. Process: Run Lock Tables MySQL Query. Run some PHP Code. Run Unlock Tables MySQL Query. While ...
1
vote
1answer
959 views

MySQL/Pivot table for two tables

I was trying to get multiple rows into a single row with dynamic columns created as per the data. I have two tables combined with foreign key. Table 1: | id | name | Invoice value | invoice_date | |-...
2
votes
1answer
985 views

MySQL deleting lots of rows by id - where in or loop over each row in transaction

I have a delete query which is potentially going to delete tens of thousands of rows. Currently it's taking quite a long time in the more extreme case (over 100000 rows to delete) using this: ...
1
vote
2answers
7k views

Load csv file to mysql using load data local infile

I need a simple way to load a csv file from my computer to the database (which is on a remote server). I'm trying to load the file using a php page that executes this code: $file = $_FILES['csv']['...
1
vote
1answer
1k views

MySQL help do I use Where not exist or Join? - Laravel

I have two tables as follows: 1) urls id domain created_at ------------------------------------------------ 1 google.com 2016-11-30 00:00:00 2 test.com ...
1
vote
3answers
14k views

How to select records where NOW is between two dates in fields?

I've searched all over for this, and I seem only to find how to get records where a single date is between two "outside" dates. I want to find out how to select records where the current date is ...
0
votes
0answers
37 views

How to show dynamic data row to data column in mysql or within php?

I have problem with query mysql. So I have database table and I've tried with my query like this SELECT GROUP_CONCAT( 'MAX(IF(day(tanggal) = ', day(tanggal), ', presensi, NULL)) ...
1
vote
1answer
543 views

Combine 4 rows based on common ID and Date

I have a query that returns 4 lines per ID. I would like to be able to merge these into one single row in a new table, based on the ID and Date. Can anyone help? I've researched and seem can't find ...
-2
votes
2answers
26k views

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

On my local WAMP stack things are working perfectly. When I upload the database on GOdaddy.com, this error shows up. Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'...
0
votes
3answers
149 views

How Can I clone a database in Microsoft SQL server using PHP?

I am creating a portal where user can create the b2c or b2b store itself, so I need to clone the sample database to perform the task. It's not looking simple to clone the database in MSSQL. Please ...
-1
votes
1answer
39 views

Displaying data horizontally in mysql [duplicate]

I have this table in my db id | major | code_lesson | files Which the contents look like this id | major | code_lesson | files 1 | Math | MAT12 | mat.pdf 2 | Socio | SOC15 | soc.pdf ...
1
vote
1answer
27 views

Should I use VARCHAR or DATETIME?

I am making a blog cms system and the release date and time of the posts should be shown on my site. Should I save the Datetime in the php code with a function and save it in a varchar in the ...
0
votes
1answer
17 views

How to select 3 records before x ID and 5 records after x ID with Laravel Eloquent?

How can I select 3 records before x ID and 5 records after x ID with Laravel Eloquent or mysql?
3
votes
2answers
97 views

Missing DB entries

I have run into a problematic situation. I oversee the administration of 5 php web pages on one server, each having their own database. All pages work like interactive forms drawing and storing data ...
0
votes
1answer
62 views

Change Data Capture in MySQL/PHP by writing to a MySQL table (rather than streaming to Kafka/Rabbit/etc)?

I have a small internal web app I'm developing with PHP and MySQL. I'm looking to sync client webpages to a server by requesting all changes since a certain date. I've found a number of solutions ...
4
votes
1answer
2k views

compare results between two select queries MySQL

I'm making test application where users will input their select queries in input box and the application have to compare them if they are identical with "correct answer" query. "Correct answer" query ...
0
votes
1answer
29 views

App Engine Standard connection to Cloud SQL Latency Randomly

I have a pretty "basic" app that we designed that was originally on a local plesk server and we migrated to GAE/GSQL/GCS. app engine, mysql, cloud storage. Here's some background info: App is PHP ...
-1
votes
3answers
23k views

Host is not allowed to connect to MySQL

I have already uploaded some files in the free web host I chose and created a database there using phpMyAdmin v2.11.4 Also, I have Googled first this question before posting this here but I don't ...
1
vote
0answers
29 views

Multiple join with self join in MySQL and split column in row

I have four tables "Commission" , "Vendors", "Accounts" and "comsplitconfig" like commission Table commissionid vendorid accountid sales commission 1 V1 A2 ...
0
votes
1answer
66 views

MySQL query takes too long in codeigniter

I've made this query SELECT id,name,iupac_name,inchi_key,molecular_weight,molecular_formula,exact_molecular_mass FROM compound WHERE name LIKE '%quer%' OR iupac_name LIKE '%quer%' OR ...
0
votes
1answer
18 views

How to perform strictly SQL query that uses multiple values and searches all fields

I'm trying to create what I would call an "inclusive" search and by that, I'm not referring to "between". I have a snippet of code and it does what I need it to do but it's hacky and inefficient so I'...
0
votes
2answers
293 views

How can I model a database structure to retain student information?

I am completely new to databases and SQL. I have generated a database in myphpAdmin consisting of a table with the columns (name, student number, grade). Basically this database will hold the grades ...
1
vote
2answers
328 views

implement geo / spatial / proximity search with php and mysql — what have you done successfully [closed]

For my website's users, I want to implement a worldwide geo / spatial / proximity search with php and mysql. I want to do this as simply and minimally as possible. What is the minimum data I should ...
0
votes
4answers
2k views

Order by numbers followed by alphabet and then null values

I have below column in my database: abc 1 2 null 100 6 I want to sort and show these values as per below sequence: 1 2 6 100 abc null Anyone please help me to solve it. Consider below query: ...
0
votes
2answers
21 views

Value of prepared statement is listed as error in query string

I have made a Wordpress plugin that writes some data to a proprietary table. The query as shown in the log is: INSERT INTO berichten_devices (device_UUID, article_id) VALUES (%s, %s) If I take ...