Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Trying to secure a payment transaction with mysqljs2

In my web app, I am trying to secure a payment transaction, that is: prevent users spending more than they have, especially in the case of concurrent execution and prevent partial execution. ...
3
votes
2answers
51 views

Order a table by column and get row number

In my database, I have table wp_postmeta, example: ...
0
votes
4answers
71 views

Appointment database - design II

I want to create a database which gives an admin user ability to create schedule for other users to book from. This is second edition of this database schema. I would like to know if there are any ...
1
vote
1answer
38 views

Appointment database design - Schema

How would you go about designing a database for service appointment? Here is what i came up with so far. Let me know if there is a better way. Basically the admin should be able to build services list,...
1
vote
3answers
97 views

Is this method for loading data in a C# application recommended?

Goal I'd like to understand if this current method, of loading data and inserting data into a database I currently use is to be avoided? Code I drafted a simple application that loads data and inserts ...
2
votes
2answers
81 views

OOP - Contact Form PHP Backend - Procedural to OOP - Dynamic MySQL Prepared Statement PHP

I just converted procedural code to OOP code. Is there any performance or security issue with this code or what should I consider further? interface ...
1
vote
1answer
70 views

SQL for precision and recall?

I have a table containing two versions of results for some predictors, one by human labeling and the other by machine predicting, and I want to calculate some metrics. ...
2
votes
0answers
16 views

Python script to collect NWS gridpoint forecast data (JSON) and push it into MariaDB

This script is my first-ever attempt at writing anything in python. Though I have an electrical engineering background and therefore got a little programming education in college, it was fairly ...
1
vote
1answer
70 views

PHP function that clones HTML form structure to MySQL database structure

I built a function that should greatly simplify working with long HTML forms, that save data to MySQL using PHP. My forms usually have several hundred input elements that are added / altered / removed ...
4
votes
2answers
169 views

Using a transaction to create account records

This is my first time using commit and rollback. I just need to know if this is a proper execution of the functions for this particular situation: ...
1
vote
1answer
41 views

I have a query like this that seems complicated and I want to do it by using Java Stream Api

I have method that fetches sorted and filtered data from Mysql Database, Firstly I had done It by using Java. Now I did it by Mysql but I don't like the way the code looks I have entity that named ...
1
vote
1answer
50 views

Calculate course module credits from individual assessment scores

I'm currently working on a grade calculator for a university (professionally), and I am wondering if anyone can suggest an improvement to the following query? Here is my database: The query returns ...
2
votes
2answers
77 views

Dapper with shops and payers

I live in the buildings that have 50 people in it and for each floor splits into 2 groups each group is from ~9 people. I'm trying to build an Xamarin app (IOS, ANDROID ,Win10,maybe web app) to make ...
2
votes
1answer
93 views

MySQL database custom session handler using PHP with MySQLi extension

I have made the decision to move the storing of session data to the database. Any new ideas, suggestions are welcome. Please also give security suggestions. Like SQL injection is possible here, etc... ...
4
votes
1answer
105 views

Storing and confirming user input

I am a beginner, and I'm trying to secure a sign-login system on my website. Is my code good/enough to prevent SQL injection? THIS IS THE SIGN FILES This is the index.php that takes user input: ...
3
votes
1answer
233 views

Login system using bcrypt and MySQL, to be used for any future projects

Main function will ask what the user wants to do. LoginSystem class will handle the sign up and login process as well with the checking if password is right. passwordHashing will use bcrpyt to salt ...
0
votes
1answer
38 views

Entity Relationship Diagram for Grade Calculator

I was wondering if anyone would be able to review my Grade Calculator for a course ERD? I'm looking for ways to improve the current design (if any improvements need to be made that is) and if anyone ...
1
vote
1answer
69 views

Web scraping cars

Is there any way to lower the lines of this code and make it better in terms of being more Pythonic? The program collects data from truecar.com and then puts them ...
2
votes
1answer
34 views

PHP filesystem on a shared file system

I have a project which we need to migrate from an on-prem solution to the AWS cloud. Currently, the software is running on a single instance. It's working fine but the business want the software to be ...
1
vote
2answers
72 views

Inserting data into MySQL

My code currently doesn't insert data into MySQL fast enough. However I don't know how to measure the current speed. ...
2
votes
2answers
129 views

Newsletter subscribers management system in CodeIgniter 3

I am working on a online newspaper/blogging application with CodeIgniter 3.1.8 and Twig. The application is meant to offer developers and designers the possibility to very easily turn their HTML ...
0
votes
1answer
68 views

First-name, Last-name and Password logging in functionality using C#

Summary I have finished creating a secure login functionality. I have used 1 resource to help me with the security. The security section was copy and pasted but implemented into a class to suit it in ...
2
votes
1answer
33 views

Input text upload to MySQL DB

I am uploading and selecting code from my MySQL DB and I have a feeling some of it could be written in a much shorter way but I don't know how. Can someone tell me if this is clean code or if it's too ...
4
votes
2answers
263 views

Creating a database, a table within the database and inserting some values into it in one go

I've written a script which creates a new database, a table within the database, ...
3
votes
1answer
35 views

Query WordPress database, returning an array of rows

This is one of my first attempts at querying the WordPress database for data, and some my first PHP code ever, so please bear that in mind when commenting. It is supposed find data between two dates, ...
0
votes
0answers
29 views

how to rewrite sql query with subquery to find max element without using limit?

the question is here Return the name of the category that has the most films. There are 2 databases - film_category: ...
1
vote
3answers
77 views

Delete companies with the least number of flights

I have solved the task of Delete the companies that made the least number of flights. the visual table diagram is here. The exercise is here This is my source code -it's "arrow antipattern"...
5
votes
2answers
124 views

PHP: Simple SQL query builder

I've been lucky enough to get my first job as a junior PHP developer. I am concerned I'm not good enough. I would like to brush up on my coding skills and get as much constructive criticism as I can. ...
0
votes
1answer
117 views

Is this correct way to setup DB Infrastructure with repository pattern and Dapper

So, I am using Repository pattern with Dapper and ADO.NET. I have my based DB infrastructure setup as follows: ...
4
votes
1answer
163 views

Calculating the Percentage of a Pair Occurring Across a Lot of Lists

I'm looking for a way to speed this code up. It took about 4.5 hours to run on ~20k decks. I'm open to restructuring my SQL query, but feel adjusting the python would be more effective. The goal of ...
-1
votes
2answers
105 views

My Script Inserts users into a database and hashes the password, I need to know how to prevent SQL injection with Procedural-Oriented MySQLi [closed]

My script works but I just want to know how I can protect myself from SQL injection with Procedural Oriented MySQLi. Most of the tutorials are about Object-Oriented MySQLi and I'm not familiar with it ...
0
votes
0answers
67 views

Simple Todo CLI APP in Python with SQLalchemy

I wanted to ask you a favor. I am recruiting for the position of Junior Python Developer (my first try in IT) and I got a task to create a script to manage the task list. https://github.com/Lok3rs/...
2
votes
0answers
79 views

Creating calendar - Speeding up PHP script

I'm working on a calendar for my office. Every people has his own column and there is a line for every day. There are some periodic date, where, for example, given people have to be working on the ...
4
votes
2answers
334 views

API for SQL queries with PHP PDO

I'm writing a very simple CRUD application, and I'm wondering if the way I'm using static methods throughout the code makes sense. I'd very much like to simplify ...
5
votes
1answer
168 views

function for PDO queries and return result - tested - any tips?

I write a function using PHP and MySQL, to get PDO connection, query and array of placeholders to execute query and return result. I test this function and it has good response when result for ...
1
vote
2answers
99 views

Repeated DB connection at max user connections

I am trying to create class with connect to mysql database. And if there is max number of connections I want to wait and try it again. I figured out, how it can works, but I am not sure, if its the ...
3
votes
1answer
291 views

Make Pagination using Ajax with Jquery, PHP, History.pushState()

Finally after a few months of searching and learning AJAX with pagination PHP and History.pushState() I created AJAX PHP pagination. Test page 1. Ajax(index.php) ...
4
votes
1answer
180 views

Is my structure of program readable?

Just looking for reviews to improve my coding and my structure of C#. It feels I probably have some unnecessary code that is not needed, been following some YouTube videos to accomplish some tasks. ...
2
votes
1answer
101 views

Is execution of sql in my php code safe?

So I have two PHP files that execute SQL code in them. It's a simple registration script and an account recover script. I want to know is my code safe from SQL exploits & other exploits? Here's ...
4
votes
1answer
54 views

Create a CSV from SQL Data and email as attachment using PHP

I put together some functions that allows a PHP script to send the SQL data obtained from user inputs on a website via an email attachment as a CSV file. It works perfectly and I have no issues with ...
3
votes
2answers
104 views

Wordpress Ajax Custom Query - High CPU LOAD

I'm developing a fully AJAX community WP theme that comes with a lot of custom queries. Everything is fine, there is no bug but recently but I had a few clients that have a huge database and my theme ...
3
votes
0answers
139 views

PowerShell Script to get data from Third Party API and insert into database

I have created a PowerShell script that will call a REST API and then for each node returned, add the data into a database table. This particular endpoint only returns ~600 records worth of data, ...
5
votes
2answers
141 views

Mysql PDO Wrapper that throws Unique Constraint Exception

The main reasoning behind this PDO wrapper, is that I find myself using unique constraints quite frequently in my designs, and I have ...
2
votes
0answers
35 views

C# MySQL library: How can I reduce bundling and abstraction?

I'm a teen developer who just does this as a hobby, but I still care about good practice even if I don't fully understand it. Two of the most used phrases when sharing the code of my C# MySQL library ...
1
vote
1answer
31 views

Possible improvement on join query

I have the following query which retrieve all those who have ordered a book_id n°10 and but never ordered the book with id n°1. http://sqlfiddle.com/#!9/1bb9e8/44 ...
-4
votes
2answers
94 views

Is this a good approach to replace mysqli_num_rows? [closed]

Is this a good approach to replace mysqli_num_rows? $db is a PDO instance. .. ...
3
votes
1answer
212 views

CRUD integration test, is it ok?

I want to test my CRUD operation to a MySql database (I use dapper as my ORM). This is what I wrote with ...
2
votes
1answer
60 views

MYSQL select count two table left join

I have two table. I want count how many times a value is in other table. So the codice from table "sorgente" is different in table contatore, because I have the suffix 'BRANO-' before the ...
3
votes
1answer
58 views

Secure upload script

I am creating a social network that let's users upload a profile picture. I just want to know if this is a secure way of doing it. Thanks. ...
2
votes
1answer
55 views

NODE JS Unlink and delete MySQL data

Here is my revised code from my other review question Node JS delete multiple MySQL linked records and delete physical file Just would like to hear some reviews if I have the right logic. ...

1
2 3 4 5
22