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

-2
votes
0answers
9 views

C# Database Manager (Mediumly Large) [on hold]

DatabaseManager.cs ...
-1
votes
0answers
10 views

How to get value and count if it appears next 3 consecutive times [on hold]

I have table with 3 columns, now how find value if it appears next 3 times immediately i.e 1st trnas_value (22) appears in next 3 consecutive times (repeaded 4 times) and 2nd and 6th also rows also ...
1
vote
2answers
26 views

Bash “Rotating” MySQL backup

I'm quite a novice in shell scripting so far, but i'm learning and getting quite comfortable in writing shell scripts, but i have a lot to learn. The snippet at the bottom of the page creates backups ...
3
votes
2answers
19 views

SELECT from “vertical” table and display on “horizontal” table

I have this table in my db: table ---------- cityID value parameterID The table looks like this: ...
3
votes
0answers
42 views

Java login system using JSP and servlets

The system is pretty simple. Here is how the database looks: ...
0
votes
1answer
34 views

SessionHandlerInterface Class

The following class is used for handling sessions: ...
2
votes
1answer
20 views

Looking for meta data which matches certain criteria and was created after a certain date

I've got the below SQL statement which runs in MySQL on a WordPress installation. I'm looking for meta data that matches certain criteria and was created after a certain date. However, WordPress ...
-1
votes
0answers
35 views

My first SQL schema - It compiles but is it any good [closed]

So I want a database to store items and users, and associate them together (only one user per item). This is what I have: ...
1
vote
1answer
33 views

MySQL Database Design for Easy Item Relationships and Meta Storage

I'm playing around with database designs to use for a new system. This system at its core revolves around various types of items (users, accounts, images), their meta (names, titles, file sizes), and ...
2
votes
2answers
83 views

Selecting data from MySQL using PHP

I have written this file in PHP using MySQL. However, I have a lot of code that looks like it could be simplified. Can someone suggest a way to make this more efficient? i.e. I want to follow the ...
-1
votes
1answer
51 views

Improving PHP Security of Login

One of my github issues is below. I am having some problems with my security, is there anything that I should or need to improve. Here is an example of code that I use, but throughout the script there ...
2
votes
1answer
72 views

C# class that handle MySQL db connection

I've built a class that handles all my connections to a MySql database. These are the function I use to create the connection(not really sure about the two dispose functions) : ...
3
votes
1answer
31 views

Query with many UNION ALL

I'm replicating a scenario on a sample set for better understanding. Database Table: Products Report required from that table, the query is working fine, and I'm able to get the required ...
3
votes
1answer
39 views

Extended PDO class for MySQL

I recently started with object oriented programming in PHP and I am wondering if my database class is on the right track. Am I doing something wrong? If so, how can I improve it? Here is the class: ...
5
votes
1answer
61 views

Inserting products scraped from the web into a database

I am trying to speed up the runtime of my program as the API can make calls. However after adding the inserts to a database 3 mins turns in 7 mins after 180 API calls, which can be one a second. How ...
1
vote
1answer
82 views

PHP/MySQL - OOP database class

I use this database class in a CMS, just a project to learn OOP. Would like to have some review on how to improve it, what should I change, add, remove? ...
-1
votes
2answers
60 views

Validating users with MySQL

One of my friends told me that my validate.php file has some problems with SQL injections. Please feel free to commit it on GitHub. ...
1
vote
0answers
27 views

Calculation of duration between two timestamps in different rows

In my sample data table below, all datatypes are varchar(255). ...
1
vote
2answers
67 views

Random uniqueID for each ID SQL

How can I improve this code? I wanted to know if there's a possibility to remove the for loop, and UPDATE a different ...
2
votes
1answer
57 views

Build SQL query criteria from form input

Very new to php. Using XAMPP, netbeans. I am using a <form> to send various input parameters as a GET to retrieve data from a very simple two table MySQL db. ...
4
votes
1answer
52 views

Database Session Class

I have made the decision to move the storing of session data from the filesystem to the database. Our application is growing at pace and we are having issues with the load balancer breaking the ...
2
votes
2answers
47 views

Returning the number of records per day

I'm writing a query to get the number of sessions created each day for the past 90 days. I'm currently using a prepared statement to do this - looks something like this: ...
2
votes
2answers
98 views

Recording a customer's shopping cart as an order

I have come up with the following method to post a transaction to a database, in the context of an e-commerce Java web application. The transaction consists in submitting a new order alongside its ...
4
votes
2answers
59 views

Increase view counter with each page view

My question is similar to before, but now the code has changed completely. I would like to understand if this code is vulnerable to mysql injection. ...
6
votes
2answers
75 views

A class to add and select players within a database

I have a question and want to know if my class is considered object oriented. ...
4
votes
1answer
29 views

Fetching all the project's items for a specific project id

In the following query, I am fetching all the projects items with specific project id. At the same time, I am using a join in Select to fetch the delivered quantity of items of this project only. The ...
6
votes
3answers
325 views

Sum of orders per customer ID

So, I have two tables, customers and orders and I want to get all orders associated with a customer. The tables look like this: ...
8
votes
1answer
45 views

Automating a WordPress install

I do not have a whole lot to do over winter break, so I wrote this little script to automate a Wordpress install (currently can only install once instance) on a fresh Debian server (tested, working ...
12
votes
1answer
48 views

Mysql homeowner database

I'm working on a project right now. I don't have much experience in MySQL, or database design, so I was hoping someone could review what I have now. This database must be able to track multiple home ...
6
votes
5answers
425 views

Function to get rows from database

I have a function that returns rows from my database, and it works fine, but I was told that it was poorly written, and there is a lot of unnecessary code in it. I'm wondering if there is a simpler, ...
7
votes
4answers
896 views

Checking 160,000 records in a database for changes

I am checking over 160,000 records in my database every 24 hours to see if there were changes in the incoming data coming from API and my existing data in the database. If there were I am updating ...
3
votes
2answers
60 views

Selecting product variants that satisfy all option criteria

My current query: ...
0
votes
0answers
64 views

Inserting a first name into a name table [closed]

I'm trying to create a secure website. Can someone let me know if this is susceptible to SQL injection? If it is, could you provide me with an exmaple of a statement that would work for injection? ...
2
votes
2answers
209 views

Inserting JSON array data into a MySQL database using PHP

Here I am parsing a JSON array and inserting it into a MySQL database. The JSON Array comes from my android code. This is how my JSON array looks like: ...
2
votes
1answer
101 views

Creating a user registration form

How should I go about creating a registration page in Windows forms? I can easily create a registration page, but I'm not sure if it's the best way. I'd have a service account that is hard coded, and ...
4
votes
2answers
47 views

JDBC connection and retrieval of info

If you are wondering why I ask, it is because I have numerous different methods all with very similar code (the only difference in the code in each method is what is between the generate ...
1
vote
1answer
25 views

Combining MySQL Left Join results [closed]

I'm trying to get the End result. I already done it with 2 different queries. Is there a better way without UNION or which one is the best? ...
3
votes
1answer
85 views

Fetching settings for batches of wafers using loops

I have this code below that needs to query multiple database tables. ...
1
vote
0answers
76 views

Mobile app backend using Gin and Gorm ORM

I'm developing backend for my mobile app by using gin-gonic and gorm ORM (mysql). But I'm not sure api and db handle huge amount requests if clients increased. for example I'm using my db struct as ...
1
vote
2answers
89 views

Substring search on multiple attributes

...
0
votes
2answers
94 views

Select records between the first and last time the speed was positive

I have the following table: ...
4
votes
1answer
456 views

Simple login system using Python Flask and MySQL

I've made a login page using Python Flask which works with MySQL. I started learning Flask 2 days ago and it was fun, so I came up with this: ...
3
votes
2answers
59 views

Classes, one responsibility principle and magic methods

I am currently building a small application that allows users to create a slideshow, each slideshow consisting of slides that are either videos or images. Although this will be relatively small at ...
2
votes
1answer
49 views

MySQL Prepared Statement - Combinging 3 seperate statements in to 1 statement

I'm currently learning MySQL about prepared statements and I was wondering if this code I've written is the most efficient way. The process: There's a query that checks a table called 'websites' ...
6
votes
4answers
228 views

DatabaseManager

I have coded a database manager in C# that connects to a MySQL database and does a few things, etc.. I just wanted someone to give me a few tips on how I can improve this, and maybe make it a bit ...
1
vote
1answer
46 views

Handle data insertion after validation

I have an application that has a form. Validation and data insertion works fine. However, it bulks out my controller. I've always been told skinny controllers. For example: ...
3
votes
3answers
216 views

Web page to add a notice, with some validation

I'm displaying multiple queries and if statements. In the if statement, it increments ...
4
votes
2answers
59 views

Watch a directory and insert new entries into database - Follow up

This is now my new code implementing the recommendations from my previous question. ...
1
vote
3answers
83 views

Registration and Login System for Application

I am developing a social platform and currently just completed the registration and login PHP pages. The application is an android application that authenticates against a MySQL DB. I am seeking ...
3
votes
2answers
63 views

Watch a directory and insert new entries into database

This program's main function is to: Watch a directory. If there are new files, insert those as entries into the database. Delete the files from the directory. My below code runs well, but I want ...