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
0
votes
0answers
12 views

How to make Admin log in

I am trying on the following code how to distinguish between normal user and the Admin login . I have given all normal users a usergroup = 0 in mysql database and the Admin usergroup = 1. Here the ...
0
votes
1answer
19 views

Need advice on combining tables or leaving as separate tables

I tried to find a related question similar to mine, but couldn't. I apologize if this is a repeat. I have an odd situation and just need advice. I have a company calendar that shows events as well as ...
1
vote
2answers
18 views

How to ensure that two or more simultaneous requests to a MySQL table don't interfere

Suppose I have about a 1000 simultaneous requests to a table in my DB which consists of these statements (in order): SELECT INSERT or UPDATE (could be multiple) DELETE and I want to make sure that ...
0
votes
0answers
16 views

How to change this query from PDO to SQLi? [closed]

I am trying to get user's information and show them in user's profile. And i found this query but it is in PDO and my work is in sqli here the query : =============================== if(isset($...
0
votes
0answers
17 views

Job for mysql.service failed because the control process exited with error code ubuntu 20.04

Tried running systemctl status mysql.service after mysql wont restart got the following log kindly help:
0
votes
0answers
15 views

Fetch Mysql row data with multiple data of same table ids in PHP [closed]

Guys below are the database structure where each message can have ids of replied messages and after that, you can see the required response. How can we achieve this with PHP and Mysql? Messages ...
1
vote
1answer
41 views

Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /var/www/html/wordpress/wp-includes/wp-db.php on line 1626

I'm just starting to code and I try to host a Wordpress website on a server of my school. However, as soon as I upload the website on the Wordpress interface with the plugin "all-in-one migration", ...
0
votes
0answers
7 views

MySQL8 leaves railing connections open

We're looking to upgrade our stack from MySQL5.7 to MySQL8. We are using a standard LAMP system on ubuntu16, php7.0 and symfony 2.3 . On our tests, I have noticed that there is a lot of trailing ...
0
votes
1answer
19 views

mysql database update possible timing issue

I have a strange situation. I have a cronjob running queue tasks one after the other. I have a delay of 1s between the tasks. After a task is run, it sets processed=1, and continues with the next one,...
0
votes
1answer
13 views

how to convert query related to calculate work hours in MySQL to MS Access [closed]

I want to calculate work hours in each day using MS Access.I have query for same thing in MySQL but this thing is not working in MS Access using pdo php. query in MySql SELECT MachineNo, ...
0
votes
0answers
10 views

mysql queries in 2 times (select) + 1 time (Insert) verifications handle problems for db to dont create double inserts

I want to make an 2 way select verification for all users in that kind of code version: select * from table_A where other_user_id='B' if (1) -> update set response_A='1' if (0) -> select * from ...
0
votes
1answer
15 views

Fetching records using some unknown join

I have two tables: 1. Users 2. Ratings Users table have columns i.e. id, name etc. Ratings table have columns i.e. - id, rate_by_id, rate_to_id etc. I want to display all the ratings in a table. ...
0
votes
2answers
23 views

MySQL/PHP - SELECT DISTINCT column based on another column with ORDER and LIMIT

I have a table named messages that is as follows: +-----+-----------+-------------+-----+ | id | sender_id | receiver_id | ... | +-----+-----------+-------------+-----+ | . | . | ...
0
votes
0answers
12 views

General error: 2006 MySQL server has gone away while adding a thread

error while adding a thread to database showing this errors Warning: Error while sending QUERY packet. PID=138803 in /home/u758467727/domains/joint2purchase.com/public_html/admin/add-thread.php on ...
-2
votes
1answer
14 views

Random ID for database users

I need to create a table with a random generator ID for users including letters and numbers for example: FT128 instead of default auto-increment ID Thank you for any help.
-1
votes
1answer
28 views

i want sql query for one category have how much blogs? [closed]

blog table: | bid | cname | ______________________________ | 29 | food,development | | 38 | fashion | | 45 | food | | 50 | fashion,business | ...
0
votes
2answers
44 views

mysql - How to remove duplicate rows in parent table and leave one row with the lowest ID, and replace foreign key in child's table with this ID?

I have the situation where I have three tables: hgn_modern_sources +----+--------------+ | id | source | +----+--------------+ | 17 | Something... | +----+--------------+ ...
0
votes
1answer
50 views

Connection failed: No such file or directory Mysql - WSL

Sorry if i posted incorrect section. I have Windows with this WSL: PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=...
0
votes
1answer
26 views

MySQL single large table vs many small tables

I'm building a website to monitor a bunch of IOT devices. E.g. Online/Offline status of each devices and some device specific information it may report back, IP address, Temperature etc this will vary....
0
votes
1answer
22 views

Split database for security and privacy reasons

Currently I have a small business where I have a main product (written in PHP and MySql), several users, several companies, etc. The software occupies around 20 tables in its operation. The problem ...
0
votes
0answers
26 views

how to insert values from different tables?

I am having a trouble from inserting values from these two tables. I have the personal, honor, and parent table. Personal Table consist of: ExamineeID FirstName MiddleName LastName Age HomeAddress ...
0
votes
1answer
39 views

Single table with multiple NULL columns vs multiple tables

I've read this. But I'm not sure if I understood correctly or my situation is slightly different. So, Here is my situation: I've a single table with customer's delivery addresses and there are two ...
0
votes
1answer
22 views

What OODBMS are available for PHP? [closed]

I need an OODBMS for my website, to handle hierarchies and inheritance. I use PHP and I have a feeling I am asking too much and will have to do with regular RDBMS...
-1
votes
1answer
106 views

How to get interval value between two hours in mysql?

I want to get value between 2 hours: 11:30:00 => 245.90 10:30:00 => 215.80 11:30:00 - 10:30:00 => 245.90 - 215.80 = 30.1 and update data every hour. UPDATE I tried like this but didn't ...
0
votes
0answers
21 views

Long running innodb query generate a big undo file in mariadb

I have a big query in php using MYSQLI_USE_RESULT to not put all the results into the php memory. Because if I use MYSQLI_STORE_RESULT it will put all of the data into memory for all results, which ...
0
votes
3answers
33 views

Deleting rows from multiples tables at once [closed]

I have a question about this piece of code I just wrote. I have a problem with the syntax, the first query executes its purpose, the problem is in the second query which does not. if(isset($_POST['...
-1
votes
1answer
24 views

MySQL tables_priv corrupted

I have a mysql database and i need to create an user for the login. This user need the privileges to only select on only one table where the login info are. on phpmyadmin when i use the gui i receive ...
0
votes
0answers
19 views

PHPMyAdmin #2002 error - fixed by restarting mysql but it occurs again

I have a LAMP server running MySQL and PHPMyAdmin. Yesterday I got the following error trying to login to PHPMyAdmin: #2002 - No such file or directoryThe server is not responding (or the local ...
1
vote
2answers
413 views

how to solve ORACLE AUDSYS.SYS space error

I am having this problem "Warning: odbc_connect(): SQL error: [Oracle][ODBC][Ora]ORA-02002: error while writing to audit trail ORA-55917: Table flush I/O failed for log ID: 1 bucket ID: 0 ORA-01691: ...
0
votes
1answer
30 views

ORDER BY with IF-ELSE statement (DESC doesn't work)

Descending sort type does not work with this syntax, please help. <?php require_once("../connection/conn.php"); $compare = $_GET["sortfield"]; if(isset($_GET["sortfield"])){ if(isset($_GET["...
0
votes
1answer
25 views

How do I handle a database for a form who's structure will likely change in the future?

I need to build a database to record form data from a custom tool. This form consists of a fairly basic set of checkbox/radio button fields so the data itself doesn't present much of a problem. User ...
-1
votes
1answer
31 views

MySql LEFT JOIN returns wrong first in PHP page, but correct results in MYSQL command line

We added two columns to our main MySQL table (named objects), a column for quantity and a column for id of the units. If the quantity and/or units are unknown, those columns are set to NULL. We ...
1
vote
1answer
233 views

does a php 7.3 cassandra driver exist?

I have php 7.3 on Debian 10. I'm trying to get the Apache Cassandra driver for php 7.3. The one provided by datastax (https://github.com/datastax/php-driver) only works up to 7.1, and the pecl one (...
0
votes
1answer
12 views

MySQL database getting connected with any username and password [duplicate]

We have a website running on an custom Ubuntu server managed and hosted by the client himself, since last two days the website database is getting hacked and someone deletes all the db tables from the ...
1
vote
1answer
24 views

Loop and array and sub array [closed]

I am working on a script that needs to loop an array and loop a sub array. I want to take in rows from a table (that piece works fine) that look like: invoice | item inv1 | it_A inv1 | it_C ...
0
votes
2answers
25 views

MYSQL Calculate ranking of row that is not yet inserted

I've got a table similar to this data: | id | username | value | |-----------|----------|-------| | 1 | bob | 46 | | 483 | alice | 90 | | 176 | sue | ...
0
votes
0answers
21 views

How to get rid of the “LOG: could not receive data from client: An existing connection was forcibly closed by the remote host.” error? [duplicate]

On Windows, my PostgreSQL window logs this regularly every day in its GUI window if I bring it up and look at it: LOG: could not receive data from client: An existing connection was forcibly closed ...
0
votes
1answer
91 views

How to properly add IPv6 data of GeoLite2 into existing table?

I'm building an application which will use MaxMind's GeoLite2 City database. By following a 2016 tutorial, I imported the data of GeoLite2-City-Blocks-IPv4.csv and GeoLite2-City-Locations-en.csv and ...
2
votes
1answer
57 views

Using PHP form to insert geometry from WKT and SRID into SQL Server 2017

I have a PHP 7.3 form that asks the user for a Name, a WKT and an SRID. I would like to upload the WKT and SRID to SQL Server 2017 so that it creates a geometric object in Upload_WKT_Test using ...
0
votes
1answer
50 views

Designing an ad banner tracker

I'm creating an ad banner tracker for the ad banners on my website by using PHP. The tracker would track unique impressions, total impressions, unique clicks and total clicks of each banner. The ...
1
vote
0answers
76 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
71 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
20 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 ...
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. ...
0
votes
1answer
22 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
104 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 ...
0
votes
1answer
151 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
903 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 ...
-1
votes
1answer
116 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
90 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 ...

1
2 3 4 5
13