MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.
-2
votes
0answers
9 views
Linux Mint - Cannot login or create databases in MySQL WorkBench and PHPmyAdmin [on hold]
I have tried a countless amount of times to manually adjust the MySQL server/workbench installation, and the PHPmyAdmin installation on my Linux Mint machine. At this point in time, I cannot access ...
1
vote
0answers
22 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:
...
9
votes
3answers
616 views
Student/Class Project Java MySQL
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
...
0
votes
0answers
22 views
Refactoring Java Method into smaller methods [on hold]
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
classes
...
4
votes
1answer
30 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
64 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
29 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
45 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
32 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
55 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
63 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 ...
1
vote
2answers
45 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
66 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
37 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
58 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 ...
0
votes
1answer
40 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
58 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
50 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 ...
2
votes
1answer
15 views
Collating client ratings
The code is fetching records from a table called CSAT_SUMMARY_REPORTS[driver table] but due to the filters conditions applied which needs to be checked in another table called CSAT_REPORT_FIELDS.
In ...
4
votes
2answers
44 views
Bash “Rotating” MySQL backup
I'm quite a novice in shell scripting so far, but i'm learning and getting quite comfortable in writing shell scripts, but i have a lot to learn.
The snippet at the bottom of the page creates backups ...
3
votes
2answers
46 views
SELECT from “vertical” table and display on “horizontal” table
I have this table in my db:
table
----------
cityID
value
parameterID
The table looks like this:
...
3
votes
0answers
66 views
Java login system using JSP and servlets
The system is pretty simple. Here is how the database looks:
...
0
votes
1answer
49 views
2
votes
1answer
23 views
Looking for meta data which matches certain criteria and was created after a certain date
I've got the below SQL statement which runs in MySQL on a WordPress installation. I'm looking for meta data that matches certain criteria and was created after a certain date.
However, WordPress ...
1
vote
1answer
34 views
MySQL Database Design for Easy Item Relationships and Meta Storage
I'm playing around with database designs to use for a new system. This system at its core revolves around various types of items (users, accounts, images), their meta (names, titles, file sizes), and ...
2
votes
2answers
102 views
Selecting data from MySQL using PHP
I have written this file in PHP using MySQL. However, I have a lot of code that looks like it could be simplified. Can someone suggest a way to make this more efficient? i.e. I want to follow the ...
-1
votes
1answer
64 views
Improving PHP Security of Login
One of my github issues is below. I am having some problems with my security, is there anything that I should or need to improve. Here is an example of code that I use, but throughout the script there ...
3
votes
1answer
79 views
C# class that handle MySQL db connection
I've built a class that handles all my connections to a MySql database.
These are the function I use to create the connection(not really sure about the two dispose functions) :
...
3
votes
1answer
33 views
Query with many UNION ALL
I'm replicating a scenario on a sample set for better understanding.
Database Table: Products
Report required from that table,
the query is working fine, and I'm able to get the required ...
3
votes
1answer
43 views
Extended PDO class for MySQL
I recently started with object oriented programming in PHP and I am wondering if my database class is on the right track.
Am I doing something wrong? If so, how can I improve it?
Here is the class:
...
5
votes
1answer
67 views
Inserting products scraped from the web into a database
I am trying to speed up the runtime of my program as the API can make calls. However after adding the inserts to a database 3 mins turns in 7 mins after 180 API calls, which can be one a second. How ...
1
vote
1answer
94 views
PHP/MySQL - OOP database class
I use this database class in a CMS, just a project to learn OOP. Would like to have some review on how to improve it, what should I change, add, remove?
...
-1
votes
2answers
67 views
Validating users with MySQL
One of my friends told me that my validate.php file has some problems with SQL injections. Please feel free to commit it on GitHub.
...
1
vote
0answers
28 views
Calculation of duration between two timestamps in different rows
In my sample data table below, all datatypes are varchar(255).
...
1
vote
2answers
71 views
Random uniqueID for each ID SQL
How can I improve this code? I wanted to know if there's a possibility to remove the for loop, and UPDATE a different ...
2
votes
1answer
61 views
Build SQL query criteria from form input
Very new to php. Using XAMPP, netbeans.
I am using a <form> to send various input parameters as a GET to retrieve data from a very simple two table MySQL db.
...
4
votes
1answer
54 views
Database Session Class
I have made the decision to move the storing of session data from the filesystem to the database. Our application is growing at pace and we are having issues with the load balancer breaking the ...
2
votes
2answers
49 views
Returning the number of records per day
I'm writing a query to get the number of sessions created each day for the past 90 days. I'm currently using a prepared statement to do this - looks something like this:
...
2
votes
2answers
99 views
Recording a customer's shopping cart as an order
I have come up with the following method to post a transaction to a database, in the context of an e-commerce Java web application. The transaction consists in submitting a new order alongside its ...
4
votes
2answers
61 views
Increase view counter with each page view
My question is similar to before, but now the code has changed completely. I would like to understand if this code is vulnerable to mysql injection.
...
6
votes
2answers
78 views
A class to add and select players within a database
I have a question and want to know if my class is considered object oriented.
...
4
votes
1answer
35 views
Fetching all the project's items for a specific project id
In the following query, I am fetching all the projects items with specific project id. At the same time, I am using a join in Select to fetch the delivered quantity of items of this project only. The ...
6
votes
3answers
333 views
Sum of orders per customer ID
So, I have two tables, customers and orders and I want to get all orders associated with a customer.
The tables look like this:
...
9
votes
1answer
48 views
Automating a WordPress install
I do not have a whole lot to do over winter break, so I wrote this little script to automate a Wordpress install (currently can only install once instance) on a fresh Debian server (tested, working ...
11
votes
1answer
48 views
Mysql homeowner database
I'm working on a project right now. I don't have much experience in MySQL, or database design, so I was hoping someone could review what I have now.
This database must be able to track multiple home ...
6
votes
5answers
435 views
Function to get rows from database
I have a function that returns rows from my database, and it works fine, but I was told that it was poorly written, and there is a lot of unnecessary code in it. I'm wondering if there is a simpler, ...
7
votes
4answers
899 views
Checking 160,000 records in a database for changes
I am checking over 160,000 records in my database every 24 hours to see if there were changes in the incoming data coming from API and my existing data in the database. If there were I am updating ...
3
votes
2answers
67 views
0
votes
0answers
64 views
Inserting a first name into a name table [closed]
I'm trying to create a secure website. Can someone let me know if this is susceptible to SQL injection? If it is, could you provide me with an exmaple of a statement that would work for injection? ...