MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.
4
votes
1answer
56 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
37 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
15 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
57 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 ...
2
votes
2answers
84 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
85 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
66 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
38 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
189 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
31 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
95 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
45 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
0answers
22 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
56 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
53 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
49 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
534 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
0answers
20 views
DB design for utility bills [closed]
In a system I need to save data for some different utility bills for electricity, water, recycling in order to make reports and calucations in the future.
Today each utility bill comes with several ...
1
vote
1answer
66 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
61 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
50 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
56 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
54 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
82 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
54 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
225 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
94 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
111 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
96 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
101 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
45 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
99 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
86 views
1
vote
1answer
35 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
33 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
39 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 ...
3
votes
1answer
62 views
Get all company branches using stored procedure
Am creating an application for a transportation company that will store information about their drivers, the cars they drive and to what branches and districts they belong to.
I have a branch table ...
1
vote
3answers
66 views
Three PHP database queries to manage accounts
I have a database connection PHP file which has a lot of queries to the database. Here are 3 of the functions that I am using:
...
1
vote
0answers
37 views
API with security through a private and public key
I want to make users login into an app. The code on my server serves a "token". This is based on a salt that is saved for each user, the login date, expDate and the ...
2
votes
0answers
72 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 ...
4
votes
6answers
75 views
Insert values into two different but similar tables
I have a combobox with two items. And if one is selected I want to write data to "salary" table and if selected another, to "other" table.
The difference between two code blocks is only one word. I ...
1
vote
0answers
23 views
auto_increment composite primary key with MySQL InnoDB
The intent is to have an auto_increment composite primary key on a InnoDB table which mimics the behavior as on a MyISAM table. The following assumes (3) InnoDB tables all with an auto_increment ...
3
votes
2answers
97 views
Checking a user's emails using an ID
I'm trying to do this:
Getting user's ID based on his email name.
Using that user_id to check all his emails that have been sent for him so far.
...
2
votes
1answer
89 views
MySQL statements to update overlapping database entries and insert new data into various tables
As I've mentioned in previous questions, I am writing MySQL statements to update overlapping database entries and insert new data into various tables. My database design looks something like this, ...
1
vote
0answers
29 views
Export database values as csv with a helper class
Should I be using getter and setter functions in my class nodeStruct?
I am currently using them where there is need to manipulate the input value (e.g for ...
1
vote
0answers
81 views
Printing many-to-many relationships in an HTML/bootstrap table
I need to print the many-to-many relation ship in my tablet. However, I don't know what to do for my case: I tried tons of ideas, however, I may have done something wrong because nothing worked.
Here ...