Questions tagged [mysql]

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

96 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
380 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 ...
4
votes
0answers
50 views

ThorsSQL Lib: Part 3: Layer 3

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
3
votes
0answers
54 views

crossword using tkinter without classes and objects

For my python project, I wanted to make a crossword game GUI with sql connectivity to display high scores so I tried to learn tkinter the only difficulty was that I cannot use classes or objects as ...
3
votes
1answer
146 views

MySQL JSON diff procedure

I'm building a procedure which compares two JSON objects and return two JSON objects with differences between each (compared keys and values). But I have relatively superficial SQL knowledge, so I ...
3
votes
0answers
682 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 ...
3
votes
0answers
1k views

Full text search for multiple words using Laravel and MySQL

I'm using Laravel 5.6 and MySQL. I need to search multiple columns for a single word or multiple words (e.g., "camhandle", "cam handle"). The way I was originally doing it was just using ...
3
votes
0answers
86 views

PHP Laravel function to search for ads in MySQL

I am new to the Laravel framework. I have recently written a function which gets called through a route. The function is created for two purposes: Get ads from a particular city based on provided ...
3
votes
0answers
175 views

Database check in a loop

I have a python script that loads a database table and checks an API for the entries found. I do it like this: ...
3
votes
0answers
303 views

MySQL Schema for Tag System Works, But Can It Be Better?

I'm working on system that tags images. I'm going to use the xxHash (lz4) for hashing images. With hashes of size 64 bits, it looks like I won't have a 50% chance of a collision until ~4 billion ...
3
votes
0answers
59 views

A function that debits a virtual wallet and calls an API to disburse to a real account

I am trying to determine if there is a better way to handle reversals for this function. This is how it works: A user inputs in amount, bank, and account number this would be used to debit his ...
3
votes
0answers
28 views

ThorsSQL Lib: Part 3: Layer 5 Request/Response

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
3
votes
0answers
37 views

ThorsSQL Lib: Part 3: Layer 2

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
3
votes
0answers
558 views

Processing database data into a multidimensional array

The purpose of this code is to get data from the database and output it into a multidimensional array in JSON for my web app. But my gut instinct is telling me this code is way too messy and just ...
3
votes
0answers
100 views

Getting a list of manufacturers from a database

I'm new to Zend Framework. Can you help me optimize this function, which gets a list of Manufactures with some conditions from a database? ...
3
votes
0answers
101 views

Keeping track of voting

There is HTML that triggers the code below I want to disallow executing the script more than once per 24 hours. I wanted this script to store the last visit time in a table against the user ID in a ...
2
votes
0answers
31 views

PySide2 Row and Column Creator

In short, I need help simplifying and optimizing this code because now that I have switched to a tree widget from 2 list widgets, loading the tables has increased by roughly 3-4 seconds (used to be ...
2
votes
0answers
31 views

Querying Aurora via Node.js

Function queries data from an Aurora database. Aurora database is the MySQL engine therefore, I'm querying it with a MySQL NPM module. If there is something better, I'm all ears. The calling function ...
2
votes
0answers
28 views

Insert data from one table to another (million+ rows)

I have a procedure that collects data from one table and inserts it into another table with the same columns, but after correlating with a few other tables. Since the existing table (from which data ...
2
votes
0answers
107 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 ...
2
votes
0answers
4k views

MySQL database schema for e-commerce website

I'm making an e-commerce site, using MySQL for storing data. ...
2
votes
0answers
71 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: ...
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 (...
2
votes
0answers
34 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 ...
2
votes
0answers
55 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 ...
2
votes
0answers
760 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 ...
2
votes
0answers
40 views

Counting distinct number of items in multiple group by query efficiently

I have the following query that counts the number of vessels in each zone for each week: ...
2
votes
0answers
44 views

Breaking down retention metrics

Does this code calculate the retention rate per acquisition channel correctly? $$ R = \frac{E - N}{S} * 100 $$ Where \$E\$ is the number of customer at the end of a period, \$N\$ is the number of ...
2
votes
0answers
308 views

Query your MySQL server for table size by row count and physical size by database

After writing a similar SQL procedure to check my table sizes several times, I wrote this stored procedure to check my MySQL database's table size. It will show you the table sizes and row count ...
2
votes
0answers
44 views

Optimising code for performance Concrete5/PHP/MySQL

I am trying to be as efficient as a I can using a CSV to import users to a CMS called "Concrete5 - Version 8.2.1". I have a list of 700+ users and i've created an upload screen to take in a CSV and ...
2
votes
0answers
58 views

I wrote some import functions from APIs for a large scale application

I run a large scaled app much larger than I can handle or develop for, website grew out of control and currently has over 22000 users. We support importing from different APIs, each import is split ...
2
votes
0answers
54 views

Joins on same table with MAX()/MIN() and corresponding fileds

I made a query for showing max and min value and dates that are corresponding to those MAXs and MINs. The idea was to show max/min value and the date when the those values occurred in one row for ...
2
votes
0answers
26 views

Filter table with drop down values given multiple constraints

I have a table that stores drop down list values. The table looks like this: ...
2
votes
0answers
462 views

C# MySQL Database Library

Below is a database manager and a class called database connection. The database Manager controls the database connection string and generates a new database connection when you need one. I'm looking ...
2
votes
0answers
161 views

Concurrent AWS S3 copying of images listed in MySQL

I created the following one off script and it did the task quite well (1000s of requests / second with low CPU usage - outperformed the previous python script in every aspect). But I am wondering if ...
2
votes
0answers
93 views

ThorsSQL Lib: Part 3: Layer 5 HandShake

Have a working version of MySQL implementation of ThorsSQL library done. If you want to check it out you can find the whole thing on github ThorsSQL. This is a follow on to previous code Reviews: ...
2
votes
0answers
156 views

PHP tagging script

I have created this PHP script in Laravel. I have database table with items and in my app I can create tags with different regexes. If regex matches text in description or epoch. I will insert ...
2
votes
0answers
44 views

MySQL Workbench RoR Migration Exporter

I created plugin for MySQL Workbench that allows you to export an ER Diagram to RoR migration files. I would like to know if any other developers appreciate it. export-rails-4-migrations_grt.py <...
2
votes
0answers
84 views

Query for searching for the best transportation

I made a website where is possible to search for the best transportation from a place to another. For instance, if I need to go from Berlin to Bremen, the website will search in its internal database ...
2
votes
0answers
26 views

Search Indexer Transaction Safety

I am writing a search indexer for a site I built. It counts the number of times a word is used in a given story allowing one use of the word per chapter. I have also attempt to weight words in the ...
2
votes
0answers
60 views

Fantasy league tracker for Game of Thrones

So I've just started learning about MySQL and PHP to create a fantasy league tracker for Game of Thrones for my office. I got it to technically work fine, but I think it's way clunkier than it has to ...
2
votes
0answers
55 views

Retrieving the most recent posts from the users someone is following

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'll show you the tables, and then the two ...
2
votes
0answers
47 views

Selecting the most recent record for each product

I have the following structure of a table: ...
2
votes
0answers
442 views

Chat application built with Node

In an effort to teach myself Node.JS and truly delve into its communication capabilities, I elected to recreate a previous chatting project. It took a bit of forethought to acclimate code to the ...
1
vote
0answers
26 views

C# MySQL Database insert list of components

I am writing a function to have insert a list of strings into a MySQL database and C#. The process of creating the list of Components: User has to scan multiple barcodes and have them stored in a ...
1
vote
0answers
79 views

Uploading files securely with php - OOP

I wrote code to upload multiple(2) files. 1.Check if this is image: mime/extension/getimagesize. 2.Remove execute file permissions from the file(chmod). Is this script secure? What can go wrong? ...
1
vote
0answers
22 views

MySQL select statement for retrieving user role permissions

I have a java project that I'm working on and I'm trying to implement in my application role-based authentication. So for example when a user is logging and he is an admin he will have access to some ...
1
vote
0answers
30 views

what is the correct way to pass 3 where () conditions in the same function, multiple filters | eloquente - laravel

see: https://stackoverflow.com/questions/58882690/what-is-the-correct-way-to-pass-3-where-conditions-in-the-same-function-mult/58883277?noredirect=1#comment104033826_58883277 to better understand ...
1
vote
0answers
69 views

Printing nested arrays

My database: Class: ...
1
vote
0answers
37 views

Listing all related details of a model object through Django ORM

How can my solution be improved / optimized? explaination of db models : thinkpad is a equipment of laptop subcategory.and ...
1
vote
0answers
38 views

Optimizing Node MySQL Query for CPU Utilization

I am working on a NodeJS port listener code that listens to a particular TCP port on the server. The obtaining the data from the port, the data is split using a delimited (for instance comma ...