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
8 views

Data Integrity Through Custom Variable

In a mysql db environment there's not really a custom global variable option. One may need that for example a certain date, in order to perhaps merge two sources of data: one legacy, and one current ...
0
votes
0answers
32 views

Report writing, do the formatting work on database or non-database language?

When report writing, sometimes getting the data you need can be quite straightforward in SQL, but getting the data in the exact format you'll need it in for the specific report can be quite tricky. It'...
2
votes
1answer
40 views

Extract users and privileges from MariaDB and MySQL

This was born out of a need to create database users on a new server to allow views to be created correctly when restoring databases. This is designed to be run from a command line NOT via a web ...
3
votes
1answer
83 views

Add post to favorite in PDO and mysql

After lot of research and couple of questions in https://stackoverflow.com/ i managed to create Favorite System in PDO mysql as ...
0
votes
1answer
58 views

Fetch and add data to MySql [closed]

Here is my very first code which fetch data and add it to MySql. Please review my code and let me know if I'm on the right path. Is there anything I can improve? postsData class = fetch and add data ...
1
vote
1answer
40 views

C# MySQL connection and some queries

Goal: I am trying to get the hang of using MySQL connections within C# windows forms. These are such areas I am targeting: Loading dataGridView correctly Refresh dataGridView from an external form (...
1
vote
0answers
32 views

C# MySQL Database insert list of components

I am writing a function to have insert a list of strings into a MySQL database and C#. The process of creating the list of Components: User has to scan multiple barcodes and have them stored in a ...
3
votes
2answers
69 views

MySQL JDBC integration into App from tutorial

I was following this tutorial for JavaFX and Gradle: JavaFX with Gradle, Eclipse and, Scene Builder on OpenJDK11 After completion of the tutorial you will have a simple GUI which you input a lower ...
2
votes
1answer
30 views

Connecting and getting mysql connection object

I have written this code that connects to a mysql database. The function should be able to be used as a context manager - via with. It is working, but I am not sure ...
0
votes
1answer
40 views

Get 3 counts from a table [closed]

I am trying to show the following results to the user All:8000 enabled:8000 disabled:0 What can I do to improve this code? ...
1
vote
1answer
56 views

Custom PHP MySQL database queries function - Suggestions for improvement or additions

For my website needs I made a custom procedural MySQL function in PHP which can INSERT, UPDATE, SELECT or DELETE data from database. I would like a review and any suggestions for improvement or ...
1
vote
0answers
40 views

InnoDB Row Locking with Transaction & Helper [closed]

I have recently started to work with InnoDB as well trying to use "helper" functions. The code below seems to work correctly however I am not sure if the true ...
0
votes
0answers
48 views

Metro Train Route and TimeTable Database Schema

I am still learning MySQL and Database design. I need experts' advice to design the database in a well-optimized way. I want to store the following data Trains, Cateogies (e.g fast, slow, special ...
1
vote
1answer
68 views

Make a specfic message according to missing column value

When a user input employee_id and book_title check its existence before insertion employee_id from student_table and book_title from book_table. If employee_id is available but book_title is not, ...
2
votes
3answers
116 views

MySQL/MariaDB Data extraction / String manipulation / “TopN” processing => Performance of C++ vs php vs python

EDIT1: Suspicion that mariadb++ is affecting my performance results compared to the raw "mariadb/mysql Connector-C"?? EDIT2: I did a barebones C-Only implementation and it comes in at 222ms vs the ...
3
votes
0answers
63 views

crossword using tkinter without classes and objects

For my python project, I wanted to make a crossword game GUI with sql connectivity to display high scores so I tried to learn tkinter the only difficulty was that I cannot use classes or objects as ...
1
vote
0answers
86 views

Uploading files securely with php - OOP

I wrote code to upload multiple(2) files. 1.Check if this is image: mime/extension/getimagesize. 2.Remove execute file permissions from the file(chmod). Is this script secure? What can go wrong? ...
0
votes
3answers
82 views

Filtering data from MYSQL database based on parameters passed with POST request

I am working on a PHP MVC project for my portfolio. Its an web app where you can store contacts (email and phone number). I am having trouble with filtering contacts based on filter form that has 3 ...
0
votes
0answers
33 views

Redundant query?

I have the following query: ...
1
vote
0answers
23 views

MySQL select statement for retrieving user role permissions

I have a java project that I'm working on and I'm trying to implement in my application role-based authentication. So for example when a user is logging and he is an admin he will have access to some ...
4
votes
3answers
140 views

Simple PHP Form Application

I have just started messing around with PHP/SQL and came up with a simple sign-in application that checks if your sign-in information is valid based on database information. Here is my code: ...
1
vote
0answers
31 views

what is the correct way to pass 3 where () conditions in the same function, multiple filters | eloquente - laravel

see: https://stackoverflow.com/questions/58882690/what-is-the-correct-way-to-pass-3-where-conditions-in-the-same-function-mult/58883277?noredirect=1#comment104033826_58883277 to better understand ...
1
vote
0answers
70 views

Printing nested arrays

My database: Class: ...
2
votes
1answer
129 views

PDO Is this registration secure and well coded?

i finally have been moved to PDO (from MySQLi) and i m now trying to make simple login and registration page (for training purposes). This code does work! But i want to know if it is secure? Also ...
1
vote
1answer
60 views

Categorize & sub categorize from contents of one row and more execute even more queries in results

I have a table called sales and it has below columns: 'id' 'product_type' 'soldDate' 'text' ...
4
votes
2answers
87 views

Query to plot a histogram of song ratings

I wrote code to plot a rating distribution, which looks like this: The most important function is the stats function: ...
4
votes
1answer
66 views

Periodically synching data from an API to database is extremely slow

I have a scheduled task where I synch all the data from one table (via an API) to another. There are about 10,000 rows that are being updated and the new ones get created. This is what I came up with ...
1
vote
0answers
38 views

Listing all related details of a model object through Django ORM

How can my solution be improved / optimized? explaination of db models : thinkpad is a equipment of laptop subcategory.and ...
5
votes
4answers
86 views

PDO MySQL queries for web application to reserve a vehicle

I normally use MySQLi and this is my first time trying out PDO. I am doing this because this is my first web application that is going to be used by the public, hence I want it to be secure. The code ...
-2
votes
1answer
27 views

Find items in 3 or less levels CASE WHEN [closed]

I have this code where I want to go trough 3 levels and it doesn't seem to work if there are only 2 or 1 levels! What's wrong with my query? ...
2
votes
0answers
35 views

PySide2 Row and Column Creator

In short, I need help simplifying and optimizing this code because now that I have switched to a tree widget from 2 list widgets, loading the tables has increased by roughly 3-4 seconds (used to be ...
1
vote
1answer
74 views

Connect to database, handling errors

I try to handle or catch possible errors with PHP/MySQL for security reasons and would like to know if I'm doing it right. The first case, connection: I use it as a function and call it always when ...
1
vote
1answer
59 views

Code improvement suggestions for cost calculation [closed]

I have to calculate costs based on country code and city(optional). There is also a condition that countries in Asia have separate pricing logic depending on both country and city and they are stored ...
7
votes
1answer
85 views

Database design for a very basic image-sharing social website

Below is the database design that I created for a basic image sharing social website. When a user signup his username, email, password save in users When the user ...
3
votes
1answer
47 views

Import Excel sheet into MySQL

This is the first project I have coded using Python. Therefore, I am looking for someone to give me some comments to further improve my code. Purpose of the application This application help the ...
1
vote
1answer
80 views

Simple CRUD back-end for an inventory-tracking web API

This is the simple back-end, albeit crude, that I made for a React Native mobile app project as a proof of concept. It's a basic CRUD for tracking supply inventory. The "shopping list" is items with a ...
6
votes
1answer
81 views

All-core MediaWiki website upgrade script

I wrote the following Bash script to upgrade All-core MediaWiki websites (no added extensions/skins or images - besides logo image). I already tested the essence of this script and it worked for me; ...
5
votes
4answers
221 views

Java methods to add and authenticate users in MySQL

I'm going through some code and trying to figure out how to get rid of duplicates from the following two methods. Both methods execute a simple login/register query to a local MySQL DB. I couldnt ...
1
vote
1answer
65 views

Create, populate, and query a basic five table car dealership database

The objective is to implement basic mySQL and relational principles, like how to handle and query one-to-many and many-to-many relationships. The database consists of 5 tables: car (car_id, ...
2
votes
1answer
157 views

PHP santization of textarea input

My application will accept textarea content that is submitted by a user, and i would like some people to review my code to make sure there is no security vulnerability such as XSS. My mySQL column ...
1
vote
0answers
39 views

Optimizing Node MySQL Query for CPU Utilization

I am working on a NodeJS port listener code that listens to a particular TCP port on the server. The obtaining the data from the port, the data is split using a delimited (for instance comma ...
1
vote
1answer
68 views

Shoutbox system

I wrote a little Shoutbox System which is working fine, but I want to know if there is something I can improve about this code. Here is my Shoutbox Overlay: ...
3
votes
1answer
199 views

Building CanvasJS Graph Datapoints in PHP Loop (MySQL Backend)

The following code is one of a few similar snippets that generate a graph using CanvasJS, with the datapoints for the graph pushed to an array in PHP during a while loop. The code pulls the the date ...
2
votes
1answer
3k views

Python Tkinter login GUI with database

I created a simple login program that works how I wanted them to work. I separated the GUI and database codes into two different python files. I named the files as login.py and dbaseManip.py. The ...
0
votes
0answers
84 views

Python script to import MySQL tables to PostgreSQL

I'm using the below Python script to port few table data from a remote server (MySQL database) to my data warehouse server (PostgreSQL DB), The script is working fine (I'm using foreign data wrapper), ...
2
votes
1answer
52 views

Dynamically inserting html from external file and updating the database

I need some suggestions on how to approach this. I want to allow users to create sections of website. The code so far is working but since I am new to back-end I feel like there is better, more ...
2
votes
1answer
70 views

Join and pivot multiple tables of securities data in MySQL

I'm interested in a way to join three (or more) tables in a way that is more efficient (both in terms of conciseness of code and in terms of generating the results) than what I have currently. ...
4
votes
2answers
120 views
1
vote
1answer
25 views

MySQL GROUP BY id, then show name

I have a users table where some users have the same name: ...
1
vote
0answers
29 views

Stored procs fine tuning for processing bulk data - 5 million records

I have this procedure which is used for bulk upload data from a temporary table (temp_rules_master) into two other related tables. It has 5 million records. The ...

1
2 3 4 5
21