MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.
3
votes
2answers
30 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
22 views
Combining MySQL Left Join results [on hold]
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
76 views
Fetching settings for batches of wafers using loops
I have this code below that needs to query multiple database tables.
...
1
vote
0answers
11 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
83 views
0
votes
2answers
83 views
Select records between the first and last time the speed was positive
I have the following table:
...
4
votes
1answer
59 views
Simple login system using Python Flask and MySQL
This is my first post on Code Review. 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
45 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
34 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
195 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
32 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
209 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
51 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
60 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
50 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 ...
0
votes
1answer
31 views
2
votes
1answer
40 views
java.sql.Timestamps: There's gotta be an easier way
I have a function that counts how many "assists" a team performs during the course of their day. The way I've written it feels bulky and inefficient using GregorianCalendar.
Basically, the ...
1
vote
2answers
33 views
Displaying completed and failed wuuks using one or two functions
I have upgraded my code. In the old code I had two functions: display_maker_success() and display_maker_fail():
...
2
votes
2answers
61 views
Database migration script
I'm working on a database migration script written in python, which will take data from a MySQL database and insert them into a PostgreSQL database with a different Schema (different table structures, ...
5
votes
2answers
94 views
Inserting a Java object into a MySQL database
I'm writing a method to insert objects into a MySQL database and while everything runs fine I feel my code is bulky and inefficient. What steps would you take to make this code more pleasant to look ...
2
votes
1answer
178 views
MySQL data fetching without page refresh
I've recently finished a prototype for a little Raspberry Pi website. The main page of the site displays current users found in the room (through bluetooth). I wanted this list updated regularly from ...
2
votes
1answer
64 views
Database Connection Program
Earlier today I asked a question as a guest (whoops) regarding my Database program. I could not comment nor post again asking for further advice from the people that answered my question. I have ...
1
vote
0answers
55 views
User model with user roles in Codeigniter PHP/MySQL
I am building an app that currently allows the users to have 3 different roles:
Consumer
Merchant
Admin
I have three tables:
user (Name, email, password etc with a status=0/1)
user_role (The ...
3
votes
2answers
104 views
Database Connection Program With HR Functionality
I've started writing a fully functional Database program in C# that allows a user to access a HR system (with more systems planned in the future). I have come over to C# from Java around two weeks ...
5
votes
2answers
67 views
User auth class and security
Just curious if my authentication is secure enough, really. Also wondering if I should ditch the secret variable and just use ...
3
votes
0answers
14 views
Obtaining employees and their roles, and vice versa
I am using the following query to obtain a employee with his information, and get all his related roles. The query underneath works fine when we check only 1 location taking only about 0.002seconds to ...
-1
votes
2answers
78 views
Accessing a list of websites using a configuration read from an XML file [closed]
I have a C# application and a CakePHP website. These communicate between them using GET and (WebRequest) POST method.
My problem is that it's happening too fast. I have made a diagram that shows ...
1
vote
0answers
30 views
Util method for generating an INSERT sql dynamically
I'm currently building software that:
'talks' to Google Analytics API,
fetches data,
persists the data to a MySql db.
Insertion of data into the db needs to happen automatically - based on the ...
2
votes
0answers
47 views
Using QSqlQuery::bindValue() for variable number of placeholders
I am familiar with the simple use of QSqlQuery::prepare() and QSqlQuery::bindValue() as in:
...
0
votes
1answer
59 views
PDO lastInsertId
In my shop system I'm using the PDO lastInsertId to assign the order_id to the products that belongs to it like this:
...
1
vote
1answer
88 views
PHP script to connect to MySQL database using PDO
Introduction
I am preparing to use a basic script to cover how you can connect to a MySQL database using PDO. This script is meant for educational purposes (introductory class on PHP/MySQL) and does ...
3
votes
1answer
32 views
0
votes
1answer
27 views
Applying prepare statements
I don't feel that my code is secure, and would like some help in using prepare statements for the following;
...
-2
votes
2answers
76 views
Using a lot of IF in loop WHILE to print information
I made a code and it is doing what I want.
But, I would like to know if I am doing it right or in the best way.
Could you please give me your thoughts about it? Thank you.
...
0
votes
1answer
24 views
Indexing columns to make a MYSQL query faster
I have this query here that I am trying to make more efficient as it is taking an extremely long amount of time, about 40s on 3 million records.
The query basically takes X amount of rows per company ...
1
vote
0answers
29 views
Archiving an SQL table of sessions and statistics
What my query is doing:
I have two SQL tables and I want to copy datarows from the one table to the other table. I am doing this for statistics. The source table includes all current ...
2
votes
2answers
84 views
Registering usernames and passwords to a database
Here is my script that registers a user to a database. I am still very much a newbie when it comes to this topic so any guidance would be greatly appreciated.
...
0
votes
1answer
56 views
Update live table in MySQL
After populating the stock_tmp table, i'm running these SQL queries via legacy mysqli wrapper code. I don't think this code ...
1
vote
1answer
26 views
Selecting mail messages that meet one of four search criteria
This is the current very repetitive and long SQL I have. Unfortunately I'm not that good at SQL to group this and get rid of the repetition.
...
3
votes
3answers
65 views
Grabbing hashed password from a database
I have just discovered the beauty of prepared statements in PHP and how they protect against SQL injection. In my first time using them, I am attempting to grab a hashed password from a database and ...
0
votes
2answers
206 views
MySQL JOIN to JSON array
I'm building a HTTP API and this part should return a JSON list of posts and their attached photos, like this:
...
5
votes
2answers
46 views
Volunteer Signup Report
I was creating a Volunteer Signup Report report in Microsoft Excel yesterday for my job and I had a moment of inspiration. What if I turned it into a website and made it dynamic? The volunteers sign ...
6
votes
2answers
99 views
Password recovery program
This is a password recovery program I made, and I just want it checked out.
These aren't all the files for the login and register system, only the password recovery part. The columns in the ...
4
votes
1answer
75 views
GUI SQL interface for select insert and remove
This is my final project for my second Java class! I would like to get some feedback on it to see where and what I can improve.
There are five class files:
...
1
vote
1answer
107 views
DatabaseManager and connection in C#
I am posting here to get a code review on my DatabaseManager and DatabaseConnection classes, and for answers on how I can improve. I won't spend too long drolling on, but this is a database manager ...
6
votes
1answer
134 views
mysql_safe_query()
I have been thinking of a sql-injection free implementation in dynamic languages. Here's what I came with. All the code was written just for fun and learning purposes.
I would like to share it and ...
5
votes
1answer
70 views
Impyla parse user args into SQL query
My Python is super-rusty and I feel like there must be a better way to do the following. I would really appreciate any feedback/pointers so that I can improve my code and skills (or lack thereof!).
...
3
votes
1answer
245 views
PHP class architecture and dependency injection
Let me start off by saying I am not new to PHP or PDO, but very new to OO PHP, and have been struggling to get a firm idea of best practices in my head regarding dependency injection and structuring ...
2
votes
1answer
73 views
Fetch entire table from database after validating the table name
I'm creating a database class. It's part academic and part something I may show in an interview.
The purpose of this method is to accept a table name as a parameter, check if the PDO Object has been ...
2
votes
1answer
73 views
Retrieving result sets from a MySQL table
This retrieves result sets from a MySQL table. The objective of this function is to correctly retrieve any number of rows (with $sql) from a MySQL table, binding ...