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

learn more… | top users | synonyms

-1
votes
0answers
21 views

Online Inventory as a simple ERP for small Business [on hold]

I am making some kind of online inventory with some basic ERP functions as make order, make invoice, generate PDF.... There are many features yet to be implemented but I want to know if what is ...
2
votes
0answers
60 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
2answers
76 views

Creating a secure and efficient DB connection and queries (using one class)

Currently, I'm working with a PHP database connection class that is in one single file with a construct. Every time I need this connection, I instantiate the class and the construct creates the ...
-1
votes
1answer
30 views

Laravel - Grab id's from multiple relations and compare them to do some calculations afterwards

Please check out my code below. I know I might be asking a lot, but this is newbie code which I feel can be improved quite a lot. So far I haven't been able to get it "better", or "simpler". What ...
3
votes
0answers
15 views

Planning the tours of home care employees as a stored procedure

We had an assignment to create a database for a fictional nursing service. To get accustomed to stored procedures we should implement one of our own choice. I decided to try my hands at writing a ...
1
vote
1answer
52 views

SQL Insert Performance

I am using a DataTable and the MySqlAdapater to insert around 100 000 rows with around 40 columns to a MySQL database. I chose ...
1
vote
0answers
48 views

Python class to get products from MySQL

This class gets the products from a MySQL database. The code is not clean, so are there any tips on how to improve? ...
2
votes
1answer
110 views

OOP PHP for handling upvoting

kinda new to OOP, and I wanna know if i'm heading into the right direction. Also I should mention I'm not using AJAX AnswerVoteManager.php ...
1
vote
2answers
88 views

One object to handle all my database manipulation needs

I have created an object to handle all my database manipulation needs. Here is my object constructor and one of its functions: ...
1
vote
0answers
88 views

Email thousands of customers from a PHP form using a MySQLi query on a MySQL database

How can a large internet service provider email certain customers to warn them about an impending service interruption? I'm providing what I think is a reasonable solution, but I have not tested it. ...
4
votes
1answer
120 views

PHP, MySQL quiz application

I'm working on a quiz application for training purposes and I think I'm done with most of it. However, I'm not comfortable with what I've done: it seems to be complicated and unprofessional and I ...
0
votes
1answer
83 views

Event sourcing with Python

I've been studying the event sourcing pattern and trying to come up with a set of classes or minimal library I can share across projects. Below you can find the implementation of this main parts of ...
2
votes
0answers
17 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 <...
1
vote
1answer
62 views

Moderation library

Here is a moderation library that I have coded and would like some help in improving the quality of my code. Most of the code is styled by rules of Resharper; Resharper has helped me out a lot with ...
3
votes
2answers
90 views

Player Permission System

I have coded a fully working permission system for my gaming emulator to determine permissions for users. What I really want to know is: Is my code standard good enough? Is the design of the class ...
5
votes
1answer
95 views

MySQL/CUPS PDF printer for STAR TSP100 ECO

This is my very first attempt at Python and whilst the script works perfectly, I'd like to see if I'm missing anything obvious or doing anything particularly stupid. I think this runs on Python 2.7, ...
2
votes
2answers
77 views

Method to Retrieve Data from a MySQL Database

I have a method that retrieves information relating to a Contact that was made between two Companies. I am looking to improve my code in any way and am intrigued in hearing any recommendations you may ...
0
votes
0answers
118 views

Insert data into Aurora DB from Kinesis Stream using Amazon Web Services Lambda Function

I have a python AWS lambda function that takes JSON records, checks them to see if they have required keys, and then inserts into MySQL db. The function gets invoked whenever a new record comes into ...
3
votes
3answers
196 views

Parameterized search query in C#

In the UI I have a single search text box into which users can type a query. The query will split the string and compare each word to each configured column in the database and return the matches. ...
1
vote
1answer
48 views

Java HikariCP classes

I'm currently making a server in Java, as database stuff I'm using HikariCP (because AFAIK, it's the best library). I try to do it as good as possible so I hope some of you can review my classes. ...
3
votes
2answers
123 views

MySQL Database Library

so I created a database manager and wanted to know if I could improove it in any way? Thanks. DatabaseManager.cs: ...
0
votes
0answers
56 views

Scraping websites and saving to MySQL

I have the following piece of code which scrapes websites and saves some information back to MySQL. At the moment is consuming all the memory on my machine every time it runs. I've refactored the ...
1
vote
1answer
30 views

Sorting by pivot table results

I had to create a report for a customer by most sold products in the last month and sorted by parameters they have assigned. We have three parameters on products: ...
2
votes
1answer
30 views

Writing line item information from multiple tables

The following is part of a personal budgeting program I'm writing. This code pulls line item information from multiple tables and writes it into an array and then displays the information by ...
0
votes
1answer
58 views

Get all recipes from database with the cheapest ingredients

I have the following query which tries to get all the cheapest products linked to my recipes and it takes 10 seconds to return from the database: ...
3
votes
1answer
55 views

Backup MySQL database for Django projects

I have a usual Django application with a single MySQL database. The purpose of this shell script is to backup a MySQL database every midnight by crontab and check that everything goes right. The ...
3
votes
1answer
69 views

List users, ordered by accuracy of soccer match predictions

I have a solution to make a ranked list of users that are predicting soccer scores. I have 3 tables: matches contains soccer matches information. ...
3
votes
3answers
573 views

PHP-MySQL sign-in and sign-up project

I have done my first PHP-MySQL project with MySQLi connection. Please review this and inform me about security and performance issues. dbconnect.php ...
1
vote
1answer
69 views

Upload bot, using MySQL excessively

I have a PHP bot running on a shared host. My account often get suspended. When I asked to web hosting service, they said that my account suspended because of excessive MySQL usage. There is an ...
-1
votes
1answer
90 views

Convert all dates in an array to date format

I'm returning an array containing dates (and other things) from an API, then looping through the array on the front end to convert them into dates The backend uses Node.Js and queries a mySql ...
1
vote
1answer
65 views

Java MySQL handler for a Minecraft mod

I am studying computer science and recently I developed an application in Java (it is a minecraft mod) that connects a MySQL database and queries to fetch, update or insert data. My DatabaseHandler ...
2
votes
2answers
59 views

SQL Query to display minimum prices per country

I have developed a Tender management System sort of code for one of my client. This is the piece of code : ...
1
vote
2answers
55 views

Iterating over a range of dates in a shell script

I have been working on a script that can be used to automatically pull the batch ids that were processed 4 days ago and which need to be processed tomorrow on the server. The batch IDs from 3 days ago ...
0
votes
0answers
89 views

Retrieving and sending encrypted data from/to database

In my Server class, I have a few methods that handle different queries to be sent to the database. Everything works fine, but I really want to DRY up this class, ...
2
votes
1answer
61 views

Python + MySQL Login system using Twilio API

This is one of my first python projects. I decided to make a semi-complex login system in Python, using MySQL and the Twilio API. The current features are: Multi-account support Two-Factor ...
3
votes
4answers
321 views

User registration and authentication in PHP and PDO

Please criticize as thoroughly as possible, even the smallest thing will be very useful for me. I'm trying to create a safe and easy system to change for future projects. I am aware that it should ...
0
votes
1answer
112 views

Display data from two MySQL database tables

This is my first attempt at PHP PDO. I needed to get data from two tables in my MySQL database. I'm pleased to say the code works, and I was just wondering if what I've done is correct. ...
5
votes
2answers
112 views

Generate SQL query by loop

I need to perform SQL query which will get products from database based on few dimensions which I will pass in URL. ...
0
votes
1answer
97 views

Checking if records exists in a table from a 1-billion row table

I have a data scraping script that runs and scrapes records, saves into the following table: For the records already existing in DB, I need to update the old records if it is not updated for the past ...
3
votes
1answer
32 views

Moving WordPress database and files to new host

I've written a script in an attempt to try to automate moving hosts from old hosts to our new docker containers. All feedback and input appreciated! ...
1
vote
1answer
124 views

Connecting to a database and running CRUD operations

I have a database class that connects to a database and runs CRUD operations. I need a critique of how well this class adheres to SOLID principles. A class to run all database operations seems like '...
0
votes
0answers
49 views

MySQL query with multiple union and group by

My database schema is something like this: desc SUB: ...
1
vote
2answers
57 views

Fetching items from database with “Outstanding” status

I am fetching around more than 300000 items through a query: ...
2
votes
1answer
115 views

Laravel generate category list from product results

I have product results with some filter, and the one is category. I'll get the category list from product results. the model category and products is one to many relationship. This is the search ...
7
votes
2answers
88 views

Multiple SELECT with LEFT JOIN to order results

I have two tables, looking like this: Table 1 ...
1
vote
1answer
37 views

Extracting site visit information from a REST API call, including addresses from a MySQL database

I'm building a web app that pulls data from a ticketing system via REST API. I'm currently able to pull all of the data I need just fine but the loading process is really slow. I'd love any feedback ...
1
vote
1answer
32 views

Getting the last post of all threads

My MySQL query is loading very slowly (over 30 secs) and I was wandering what tweaks I can make to optimize it. The query should return the last post with the string "?" of all threads. ...
-1
votes
1answer
37 views

Is the format of this PDO mysql statement correct

I have been writing simple php programs, trying to adhere to the PSR standards, for writing code. However they do not seem to have any standards for writing mysql PDO statements in. For example I ...
2
votes
1answer
40 views

Eliminate redundancy from session authentication

I have a session authentication script and it works, but I can't find a way to eliminate the redundancy where the two database queries are. One checks if the cookie has a corresponding entry, and the ...