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

0
votes
0answers
8 views

Sorting timestamp using the date not time (php, mysql) [on hold]

I'm having a bit of a problem trying to solve this one, Currently i've got a php script that scrapes data from a MySQL db, on one part of it the DB has a timestamp which has date and time in it. ...
1
vote
1answer
13 views

Get all members from country depending on multiple tables

I have 4 tables, filled with some example data user table ...
0
votes
0answers
24 views

MySQL stored procedure to search medical insurance claims

This stored procedure is taking a lot of time to execute. How can I optimize this query? ...
1
vote
0answers
22 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 ...
6
votes
2answers
42 views

Database design for a transportation company

I am designing a database and I am just wondering if I am doing it correctly. I have tables for things like State with all the states in them and then I reference the ID in other tables. But should I ...
2
votes
2answers
24 views

Insert into two tables during user registration using PHP

I'm working on creating a user registration script in PHP. I have two tables that need to be inserted into. One that stores some general user information, and another that stores their login ...
2
votes
1answer
40 views

Sales report for an invoicing system

I am creating a sort of Sales Report for an Invoicing System. I have an extremely complex MySQL Query that takes a very long time to execute (usually about 10 - 15 seconds). It involves multiple ...
5
votes
2answers
164 views

List<dynamic> to ComboBox

This code get a list<dynamic> from a repository class using Dapper. I need to bind this list to a ...
0
votes
1answer
25 views

SQL query with GROUP BY to show badges and points by user and course

I have the following database schema. My goal is to obtain a result set that lists the total badge points earned by each user. The badges might be earned in different courses. I want to include the ...
4
votes
1answer
53 views

SQL query that flattens many-to-one relationships

I have a database with these tables, where each mapping table represents a "many-to-one" relationship between the table on the right and the table on the left (click to enlarge): I am selecting a ...
0
votes
0answers
22 views

Function that creates an object graph from database rows

Using a low-level database driver called mysql, I run a query against the database: ...
3
votes
0answers
47 views

Fantasy league tracker for Game of Thrones

So I've just started learning about MySQL and PHP to create a fantasy league tracker for Game of Thrones for my office. I got it to technically work fine, but I think it's way clunkier than it has to ...
3
votes
1answer
40 views

Transfer XML data to database where table fields must match with elements

This is my first Java program, where I have a class that gets XML data from a certain website and another class that does all the database related tricks. I omitted all non-related code to this case. ...
1
vote
1answer
33 views

Simple bcrypt Register User and User Login using PHP - is this approach acceptable?

I am learning PHP and have been looking into a suitable way to safely store password data in MySQL. Following advice from here ...
3
votes
2answers
257 views

Selecting all movies where specified actors worked together

Here's a query I wrote trying to find all movies that three actors have been in together: ...
1
vote
0answers
19 views

Send Google Cloud Messages

I wrote code which is doing query and insert inside while loop. ...
0
votes
3answers
80 views

Datagridview filter with BindingSource

I want to perform a filter on a DataGridView using 3 different TextBox. The solution below works, but does not consider very ...
0
votes
0answers
9 views

Select Server Settings from one table if the status reads 'issued' in another (mySQL stored procedure)

Just wondering if this is OK to do. If I don't have the else statement I get an SQLException because the query doesn't return a result. Is there a better way? ...
4
votes
2answers
81 views

Using PHP PDO to Fetch Employee Details

Introduction Hi, I am finally making the move to object oriented PHP. This has been something I have been quite reluctant to do, but I now feel that it could benefit me, and bring me up-to-date with ...
1
vote
0answers
50 views

Efficient MySQL PDO Class

I tried to create a secure and efficient PDO class.I would really appreciate your feedback to make it more production ready.Github Link ...
2
votes
0answers
35 views

Retrieving the most recent posts from the users someone is following

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'll show you the tables, and then the two ...
1
vote
0answers
12 views

Table Trigger to update date columns

I've created the following trigger to force two columns (date_edited and date_deleted) to have the ...
1
vote
0answers
23 views

Bulk customer creation

Here is my script which takes 50k records from a CSV and does CRUD operation with them. Unfortunately there are a lot of issues with the performance. CSV fields are: msisdn, resellerid, product ...
3
votes
0answers
32 views

Selecting the most recent record for each product

I have the following structure of a table: ...
1
vote
3answers
49 views

User-tracking history query

I have a query consisting of UNIONs. ...
3
votes
1answer
64 views

Is this query vulnerable? ( MySQL Injections )

Already many days I'm documenting about the SQL Injection. I was wondering if the code I wrote is vulnerable in some of its parts. ...
4
votes
1answer
88 views

PHP secure login script

I was just wondering how secure my code looked and if I'm overlooking any serious mistakes. Any suggestions/critiques are welcome. This is my relevant login script. login.php ...
2
votes
2answers
76 views
0
votes
2answers
49 views
2
votes
1answer
51 views

Generating a MySQL query

I'm trying to create a function to return a DataTable with the results of a MySQL query where the program doesn't know the names of the queried columns until run-time. How can I improve the ...
3
votes
1answer
31 views

Splitting apart a comma separated list

I have a system that outputs a comma separated string into a single column. I need to grab the individual values out of that list. The list could have random spaces and commas that need to be ...
0
votes
1answer
79 views

Query Builder for Mysql Extension

source : https://github.com/Zakisu/QB_Mysql/blob/master/mysql/Mysql.php please review mycode read the docs about the usage ...
2
votes
0answers
36 views

Node my Chatter

In an effort to teach myself Node.JS and truly delve into its communication capabilities, I elected to recreate a previous chatting project. It took a bit of forethought to acclimate code to the ...
1
vote
1answer
41 views

Fetch data from multiple tables

I have three primary tables: Customer Product Order Relations: Many to many between product and order. ...
1
vote
1answer
100 views

PHP Login script getting bypassed allowing access to my admin pages

I have a site where a friendly hacker says they have accessed my admin area. I am not able to see how this is possible so any help would be greatly appreciated. I am using PDO prepared statements to ...
1
vote
2answers
65 views

Security concern for SQL Injections/XSS

This question is everywhere, and I looked at many answers. A lot suggest using mysql_real_escape_string but that isn't an option, since it's depreciated now. ...
3
votes
1answer
58 views

Simple shop database site

I'm learning PHP, HTML and SQL - and wondered if anyone could take a look at this code and give me some feedback? ...
1
vote
1answer
105 views

Global site settings middleware for Slim Framework 3

I have created this middleware code for slim. I just want to know that is this right way to store site settings globally. so, I can use where ever I want. What do you think about my class structure ...
0
votes
0answers
8 views

Robustly send notifications from multiple processes

We have Notifications stored in a notifications table, which is worked on by multiple background workers. The notifications table has these relevant attributes: id (primary key, unique) send_at ...
1
vote
1answer
41 views

Database query inside a method of a class and return data [closed]

I'm trying to find out what is the right approach to return DB values from a class. This is what I came up with: ...
1
vote
0answers
35 views

Student/Class App Java/MySQL

I posted a question about this code yesterday and have made several updates. I'd just like to know if there are any other major errors or spots for improvement. I have three MySQL tables: ...
10
votes
3answers
689 views

Acquiring user information about students and classes

I have a Java application that uses a few switch statements to get user information about students and classes. I have three MySQL tables: students student_id | student_name | hometown ...
4
votes
1answer
43 views

PDO connector class

I have created a DB connector class with PDO. Do I need to add, delete or edit anything in this code? ...
2
votes
2answers
109 views

Insert rows in the datagridview with a dictionary

I would like to improve the function below without calling twice InserisciRigaNote. Before I fill my dictionary. When I compare ...
1
vote
1answer
65 views

Class to create dynamic php + mysql queries (safely)

I've started to learn PHP classes, interfaces, extends and things related to those. Before this i've worked only with functions and it started to be quite a mess with hundreads of separate functions. ...
3
votes
1answer
57 views

Displaying a 0-7 ratings graph

I store ratings in a table called ratings. The table has these columns: id | user_id | value | ip | showcase_id value is ...
1
vote
0answers
35 views

Potentially complicated query for advertising campaign

I'm looking for some expert advice with my working script below. What I'm after / how the code works: A merchant creates an advertising campaign with (let's say) a total budget of £100. He then ...
3
votes
1answer
56 views

Possibility of SQL Injection

I am requesting a review of a portion of a 600 lines of code. This portion of the code process a filter that is farther down the page. It takes in the parameters and formats them into a query. Now I ...
1
vote
0answers
17 views

MySQL Group PO Data in Ranges with Avg Number of Approvals

I expanded the query provided by Gordon Linoff ...
4
votes
1answer
140 views

Calculating exponential moving average across millions of rows

I am calculating the moving average for 5,534,446 rows in one table. I am using C# as my language and MySQL as the database. Below is the code I am using to gather and calculate an exponential moving ...