A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
1
vote
0answers
11 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 ...
-1
votes
0answers
10 views

Redirected page still running past redirect [closed]

TL;DR Rows were being inserted into a database after the page was already redirected away. I'm making an admin page for a restaurant and I was working on adding options for menu items when I came ...
0
votes
1answer
31 views

Get 3 counts from a table

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? ...
-3
votes
0answers
18 views

Why flask blueprint not getting changes and routes aren't working? [closed]

I was working on a basic news flask application since one month. I was started get some 'ImportError', then I got help from stackoverflow to use 'flask blueprint' for better management of my ...
2
votes
2answers
31 views

Querying nearest city with a given shop using latitude and longitude is slow

I am using the following query to search for the nearest city to my location from the cities table using latitude and longitude. The query also checks whether the nearest cities to my location have ...
-3
votes
0answers
34 views

Convert MYSQL query to PHP Query [closed]

I have a MySQL statement that works well in the SQL testing area within phpMyAdmin via my ...
1
vote
1answer
46 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 ...
2
votes
1answer
1k views

Scrape google apps page and store application details in database

Below is a python script which scrapes specific google apps url for example https://play.google.com/store/apps/details?id=com.mojang.minecraftpe and save the ...
1
vote
1answer
65 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: ...
1
vote
1answer
1k views

Separate areacode from phone number string with MySQL Database

I have a database with 5000 entries of local area codes to separate the area code from a phone number string. I'm not sure if the code I use is the fastest way to solve these job. I shrink the ...
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
23 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 ...
6
votes
3answers
963 views

Converting a query result into an key=>value pairs for a lookup table

My app has a number of lookup tables stored in a MySQL database that are used for various purposes such as a select element. Unfortunately, the query results aren'...
0
votes
0answers
50 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, ...
1
vote
0answers
74 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? ...
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
2answers
96 views

Optimize Multiple Insert SQLite Coming From MySQL

I'm currently developing an app that requires sending and receiving of data from android studio going to MySQL and then data coming from MySQL will be saved from the SQLite. I need advice on how to ...
3
votes
3answers
202 views

PHP script security for new user registration

I would like to ask the experts here if this is secure. If it is not can I get an explanation as to why it would not be secure? I have been reading off and on on sites for this and I have trouble ...
3
votes
3answers
104 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
51 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 ...
0
votes
3answers
78 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 ...
19
votes
2answers
603 views

A take on DB Abstraction

It's a little bit more code but I wanted to show the full class. I highlight the points I'd like input after the source. I've cut comments since they where not in English and translated the important ...
0
votes
0answers
27 views

Redundant query?

I have the following query: ...
1
vote
0answers
22 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
133 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
29 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 ...
2
votes
0answers
28 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
0answers
67 views

Printing nested arrays

My database: Class: ...
2
votes
1answer
117 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 ...
4
votes
1answer
65 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
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
82 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: ...
1
vote
0answers
34 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
84 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
26 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? ...
6
votes
1answer
78 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; ...
3
votes
2answers
115 views

Php registration form input is required validation

Ok, so I have been looking for resources on how to make a registration form work with input validation. I want the error message show up under the table of the registration form and not on top of the ...
4
votes
3answers
833 views

Is my login system secure?

I am recently making a CMS and I need a secure login system, so this is my code. How is it? First: the HTMLcode for signup and login: ...
7
votes
2answers
1k 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. ...
1
vote
1answer
73 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
72 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
40 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 ...
6
votes
1answer
2k views

Fastest way to insert rows in mysql vs sqlserver (large dataset)

I'm looking for any possible improvements that could be made to run the mysql piece of code faster. I created a simple test winform application that creates two docker databases : Sqlserver on linux ...
1
vote
1answer
72 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 ...
5
votes
2answers
8k views

Better multithreading with network IO and database queries

I'm writing a script that: fetch a list of urls from a db (about 10000 urls) download all the pages and insert them into the db parse the code if(some condition) do other inserts into the db I have ...
2
votes
1answer
2k 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 ...
1
vote
0answers
37 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 ...
5
votes
4answers
219 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 ...