658,785 questions
-4
votes
0
answers
27
views
MySQL data base intitalization is failing [duplicate]
This is the log I get for database initialization failure
Beginning configuration step: Writing configuration file
Saving my.ini configuration file...
Saved my.ini configuration file.
Ended ...
4
votes
1
answer
99
views
Update table 1 columns based on whether the column name exists as a value in another table
I'm trying to figure out an efficient way to do this, preferably as a single MySQL query. I have two tables that look approximately like this (I simplified it as best I could):
table1
CREATE TABLE `...
-1
votes
0
answers
123
views
Use of named parameters in MySQL subquery with PHP8 [closed]
I have 2 tables customers and addresses (each customer can have many addresses)
The customers table has two fields of interest:
userName (varchar)
userID (varchar)
The addresses table has two fields ...
Advice
0
votes
7
replies
144
views
How do I choose a file destination in html/php?
I am using a html file type where the user can upload images. I am trying to determine the file location.
I want it to go to the current file (where the php file is in) and then database\images.
I am ...
Best practices
0
votes
9
replies
92
views
Case Expression in Where clause
Isn't it much easier to write this:
SELECT *
FROM your_table
WHERE CASE
WHEN CURTIME() BETWEEN '11:01:00' AND '15:00:00' THEN created_at BETWEEN CONCAT(CURDATE(), ' 11:01:00') AND CONCAT(CURDATE(), '...
Best practices
0
votes
3
replies
93
views
Do SQL databases apply WHERE filters before joins?
from a in xx
join b in yy on a.someprop equals b.someprop
join c in zz on a.someprop1 equals c.someprop
where a.someprop2.Contains(strval)
I’m trying to understand how SQL query execution works ...
Advice
0
votes
1
replies
65
views
create database in server(truenas scale)
I am running a server using TrueNAS SCALE. I want to save all of my shop's invoices directly to the server and be able to view them from my computer. I am familiar with SQL for database management. ...
3
votes
1
answer
116
views
Using REGEXP instead of AND condition
I am writing a query where the user can enter a comma(,) separated value which would be used as an AND condition on a single column - lets say address - for refined search.
For example:
/**
* Search: ...
0
votes
1
answer
63
views
MySQL throw ERROR 3098 .. table does not comply .. external plugin when FK exists
So I understand that in a group replication I must have either:
Primary Key, OR
a NOT NULL UNIQUE column that will act as PK ( InnoDB choose it automatically )
In my case I do have an explicit PK, ...
Advice
1
vote
15
replies
76
views
Is there a function (python or PHP) that will return a string that has properly quoted user input suitable for MySQL?
When updating a MySQL database with python3 or PHP, one ensures that the user-supplied values are appropriately protected by using something like:
statement = "INSERT INTO t1 (c1, c2, c3, c4 ) ...
Advice
0
votes
2
replies
46
views
Peewe new version 3.15.6 autocommit
In old peewe version 2.8.1 we had some manula quirks like below
def configure_proxy:
proxy.obj.require_commit = False
proxy.obj.autocommit = True
proxy.obj....
2826
votes
58
answers
5.4m
views
How can I import an SQL file using the command line in MySQL? [closed]
I have a .sql file with an export from phpMyAdmin. I want to import it into a different server using the command line.
I have a Windows Server 2008 R2 installation. I placed the .sql file on the C ...
Best practices
0
votes
5
replies
162
views
How to condense multiple boolean columns into one column in laravel?
How do I design a scalable user badges system without creating many boolean columns?
I'm building a badge system where users earn specific badges by completing certain tasks.
Schema::create('...
-2
votes
1
answer
115
views
How to exclude records based on conditions in related tables in SQL? [duplicate]
I have two tables: Patient and Encounters. They are related through an ID for each patient, with the ID appearing as "Id" in the Patient table and as "Patient" in the Encounters ...
-1
votes
1
answer
150
views
Failed to initialize JPA EntityManagerFactory: Unable to build Hibernate SessionFactory
I'm new to Java programming and while trying basic programming, I tried to connect java with Mysql Db where i am facing below issue,
Failed to initialize JPA EntityManagerFactory: Unable to build ...