Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mysql]

MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.

0
votes
0answers
14 views

Doctrine Query with subquery

I'm wondering if this is the right way to have a subquery in Doctrine. I have two entities, one called User and one called Log. ...
2
votes
0answers
27 views

Python graphene-graphql, are global constants for SQL queries a good idea?

For python 3.6.5 using graphene-graphql and mysql-connector Context: I wrote an API using graphene, a python graphQL implementation, this is actually my first time using the graphQL specification so ...
1
vote
0answers
20 views

MySQL database connector

I want to connect to a MySQL database in JavaScript in an OOP compliant fashion. I'm not sure if I'm trying to adapt my Js code to read like Java too much. I'm wanting to learn how to store 'vars' ...
2
votes
3answers
191 views

Adding / updating user info into MySQL database

I'm working on an app that will be used for employee management and I'm using MySQL for the database. You can add employees, view/update/delete them, and on the dashboard I'm listing them in different ...
-1
votes
0answers
26 views

A simple golang web server that makes a query to a mysql database

I have a short go program that makes a simple query to a mysql database. The database is intended to contain data for a library, but at the moment only contains a single table with a single column ...
2
votes
0answers
39 views

MySQL database schema for e-commerce website

I'm making an e-commerce site, using MySQL for storing data. ...
0
votes
1answer
22 views

Get chat message data from table, grouped by date

Giving the following table: ...
1
vote
1answer
68 views

My Python 3.6 script to detect stamp card redeem fraud and prepare a csv report

I have a requirement to write a Python 3.6 script which should be able to detect following case within a time period and be able to create a text file report that lists the condition violated and ...
2
votes
1answer
105 views

PHP code to insert phone number and IP address into a table if not already present

I am currently coding a PHP script that connects to a database and inserts a phone number and IP address if either item is not present in the table. I believe I have completed it and it is working but ...
3
votes
0answers
97 views

Generic Unit of Work implementation

I am implementing the unit of work pattern to be used in the logic layer of my application. The goal is to abstract away the tasks of managing transactions / connections. My implementation relies ...
0
votes
1answer
59 views

Getting data from REST API (JSON), extract variables and upload those to database using MySQL [closed]

I'm working with a REST API, first time doing this and I have a working code but it's long and just looks messy to me. I just know there's a better and faster way to do it. ...
1
vote
1answer
86 views

Edit database content with a web page

I'm new to PDO, and I want to make sure I made this in the correct way. This way is working, but I have a feeling it's unclean. I have this input: ...
2
votes
4answers
273 views

using $_POST array to prepare PDO statement with variables

I have been developing a little, private Blog Site to make notes/ stories of pen and paper rpg games available for me and my players. This is my first project. As I am new to coding in PHP and MySQL ...
0
votes
1answer
50 views
0
votes
0answers
7 views

Dynamic Statement Executor

I've written a stored procedure in order to simplify the process of calling dynamically constructed MySQL statements: Implementation ...
1
vote
1answer
70 views

Auto generate database table

I have written my own little auto-generated table class, and I was wondering if you guys can give me some tips on how to make this code more elegant and secure and maybe compact it so I use only one ...
3
votes
0answers
44 views

Automatically generate TypeScript classes from database tables

Made a project to generate TypeScript classes from database tables, and I'm looking for input if the code is reasonable. pg and ...
-5
votes
1answer
60 views

How to write SQL in a industry standard style [closed]

Here are the commands I ran to start setting up a database I need. ...
1
vote
3answers
141 views

PHP script security for new user registration

I would like to ask the experts here if this is secure. If it is not can I get an explanation as to why it would not be secure? I have been reading off and on on sites for this and I have trouble ...
1
vote
1answer
151 views

Scrape data from a webpage and store them in a database

I've written a script in python to parse different names ,bubbles and reviews of various ...
1
vote
1answer
36 views

Calculating COUNT(*) of a MAX() + GROUP BY query

I have a SELECT query I'm executing which has a MAX() column and a GROUP BY clause, and in ...
1
vote
2answers
59 views

Merge both sql queries into one to get the performance

Currently i am using 2 queries - one for reattemptdate & one for holddate.... if we merge both queries & get the results in single query , than will it give better performance? if so how to ...
-1
votes
2answers
68 views

Tracking employee data

We have hundreds of employees and for tracking each employees' data, and I am using this code: ...
1
vote
0answers
32 views

Implementing an In-house Badminton Ranking System

I am working on a project and wanted to have a quick look by you people if the schema or query needs some changes or does it totally needs to be changed. The project is about creating a ranking ...
2
votes
0answers
57 views

One class for MySQL and MSSQL Queries

EDIT BELOW I am trying to create resusable classes for MSSQL and MySQL queries (later also Update and Delete queries). I tried it doing the OOP-way. Here is my result: Einstellungen.vb: ...
1
vote
1answer
136 views

MySQLConnection Conn.Connect()

I'm pretty new to working with databases, and I would like to know if I've made some common, major design flaws in my implementation. For context, the whole project is intended to be used by a single ...
-3
votes
1answer
50 views

Is there a different way of implementing this program without using nested while loop? [closed]

Presently my program is working properly, but how do i implement this program without using nested while loop(one while loop within another while loop).This is a kids way of programming and my office ...
2
votes
0answers
58 views

Exporting tables from 30 databases

What my code do: Connecting to 30 DB (consistently) Copying DB file to temp.dat Reading temp.dat Writing read data to file So, it connects 30 times with different databases. This take 6-7 second (...
3
votes
2answers
359 views

Using Python to create a JSON file of recipes from MySQL

I needed to create a JSON file from a couple of MySQL tables to migrate some recipes from wordpress. This was my first time writing a script in python and would like to get some feedback on what I ...
1
vote
2answers
63 views

Encoding multiple rows from prepared statement in php [closed]

I have this code that hypothetically returns multiple rows from a database and encodes them in a JSON. I am wondering if this is the best and most presentable way to do it. Note: I am using msqli ...
-1
votes
1answer
87 views

PHP/MySQL login

I just wanted to ask if this is a secure code (doesn't really matter if it's optimal or not) The code ...
-3
votes
1answer
45 views

3 tables in SQL [closed]

Lets say i have 3 tables: users, posts and comments. ...
0
votes
1answer
52 views

Using MySQL with Wai and Warp

I was wondering if below is the correct convention for combining Wai with a Database pool. What I basically do is, create a pool, partially apply a function of type ...
2
votes
0answers
33 views

Many to many (n to m) relationship without insert duplication php

I managed to make a many to many relationship work correctly using mysql, doctrine 2 and symfony 3.4. When a new element A that contains 0 to m element Bs is inserted, the B elements that already ...
3
votes
1answer
37 views

Stored procedure for sending emails at specified times after license expiration

I need to send email notifications for expired licenses: One Day Before/After Expiration Two Days Before/After Expiration Three Days Before/After Expiration One Week Before/After Expiration Two Weeks ...
2
votes
0answers
47 views

Calculating effective shop inventories (SQL)

This is an SQL version of that question. Shops and groups The problem domain is a collection of shops (identified by an int shop_id number) each of which is ...
1
vote
1answer
2k views

Basic object-oriented PHP login, logout, and registration scripts

I am new to OOP in general and have recently started trying to develop object-oriented PHP code instead of relying on a primarily procedural style, as this is a requirement for my studies. One part of ...
0
votes
1answer
82 views

PDO insert data through transaction method

I have an import books function to insert more than 5000 rows at once, I did some research and did this one but some other places I saw a different kind of methods to insert without looping and ...
0
votes
0answers
66 views

Querying 2 or more tables with joins or eloquent relations

I have few tables that store the details of educational content within a school. Tables' descriptions viz. A grades table stores all grades, subject table stores all subjects, ...
0
votes
1answer
63 views

insert multiple tag

I have 3 tables such as books, tags, book_tags. my objective is to insert books info along with tags (tags can be multiple or single). I have two methods one is insert books info 1st and then add tags ...
2
votes
1answer
87 views

Model database for contract renewal

I have made a contract renewal system in Symfony and Doctrine, and it works, but I think it can be improved, but I make too many requests to the database. These are my models: ...
1
vote
1answer
65 views

HTML file with a submit form

I have an HTML file that contains a submit form, which asks the users the fill in their personal info: then it will post and store into the DB by method of PHP SQL: ...
3
votes
2answers
45 views

Pulling log messages from a MySQL table

I want to get this code reviewed for a function I wrote that pulls log messages from a MySQL table: ...
2
votes
0answers
322 views

Async/await Mysql wrapper

I used MySQL, but it was inconvenient so I made a wrapper. It works, but I'm unsure if there are any issues. Used node module - mysql2, bluebird sqlWarpper.js ...
-1
votes
2answers
100 views

MySQL select between MAX-n1 AND MAX-n2

I just made this link please check this out Online Results I need to select data between 2 values from a table by using MAX because each SID has different VID. My code: ...
4
votes
1answer
264 views

PHP Application layers

I'm dealing with design layers of an application. Basically what I've so far are: Business Architecture: Client-Server Techonologies: PHP+MySQL, HTML5, JS, 3rd parties APIs My app Data Sources: ...
7
votes
0answers
75 views

Science Fiction Wall of Fame (Shame?)

I have a few of hobbies, one is reading science fiction and fantasy and another is coding solutions. I thought I might have a chance to combine both hobbies on this project. I have well over 1500 ...
1
vote
0answers
50 views

mysql query for color/size filter PHP takes time to load

I have an online shop on a custom PHP platform and I have some difficulties on optimising the color/size filters. At the moment it takes 30 seconds to return the query. You can test it here (the page ...
0
votes
1answer
67 views

Cross-platform MySQL database backup using mysqldump

In a Laravel (PHP framework) project, we implemented a backup feature - backing up user-generated files and database tables. What we've searched so far, the best solution in backing up mysql database ...
2
votes
1answer
960 views

Fetching categories and subcategories from database

For a small blog with a limited count of categories, I wrote this code to fetch categories and subcategories from the database. I used a recursive function to call all categories and sub categories , ...