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
11 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
49 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
17 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
38 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
38 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. ...
0
votes
0answers
26 views

Creating Mysql interaction/connection using OOP in PHP [closed]

I'm very new to OOP and but am aware of the concepts after educating myself with some good resources despite this I want to get expert knowledge on the direction I'm taking for this project I've set ...
1
vote
1answer
30 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
247 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
67 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
62 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
39 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
30 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
21 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
31 views

Selecting the most recent record for each product

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

User-tracking history query

I have a query consisting of UNIONs. ...
3
votes
1answer
62 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
65 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
73 views
0
votes
2answers
48 views
2
votes
1answer
49 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
29 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
75 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
35 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
80 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
62 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
55 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
79 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
31 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
682 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
41 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
85 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
51 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
54 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
34 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
107 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 ...
2
votes
2answers
47 views

Small PHP CMS base

I am a bit worried about this small PHP base as it has been running a bit slow. Can anyone notice anything majorly wrong with it? root/Index.php: ...
1
vote
1answer
186 views

Passing Node.js SQL connection to multiple routes

Here are the app.js, users.js and user.js routes of a node application I am building. As you can see I am connecting to the SQL DB in each route, and this is not ideal. I have tried passing the ...
1
vote
1answer
45 views

Product inventory database

I just finished writing a program which working with a database. Throughout the process when working with people to get past some of the hurdles I faced I was ridiculed for my SQL statements. I have ...
3
votes
1answer
90 views

Checking if a student ID is present in the database

What I need to do is fetch the XML link using curl then get a student ID and check if the ID is present in the database. If yes, then I need to get other details from another database table. My code ...
-1
votes
1answer
55 views

I'm not sure if my query is safe or I need an extra step to sanitize data

I'm not sure if my query needs extra steps to sanitize data to prevent SQL injection. If I use $wpdb->get_results($query), do I need to ...
1
vote
1answer
60 views

Making a lot of requests with MySQL while trying to keep good performace

This is what the code does: Check if the user's website exists and is active. After checking the user IP already exists and if the weather 24 hours have passed, if so it deletes the IP database. ...
0
votes
0answers
54 views

Converting CSV To MYSQL With PHP In My Custom Wordpress Plugin

I have a function which converts a file from CSV to MYSQL The file could be 5,000 rows long up to 90,000 rows long. Based on ...