MySQL is an open-source, relational database management system. If your PHP code uses MySQLi, use the MySQLi tag instead.
2
votes
3answers
33 views
-1
votes
2answers
34 views
1
vote
1answer
40 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
0answers
21 views
Verification Link Not Finding User Account In MySQL Database From Signup Details [on hold]
I am having an issue where when I click the verification link that my site sends a company/client to verify the email address for login I receive "Sorry, We have not found account. Please register ...
-1
votes
0answers
11 views
mysqldb inserting list of values into a table [closed]
I am trying to pass some values from a list into an insert statement and thought it would be straightforrd enough but I find myself wasting far too much time on this:
please could eomeone explain ...
3
votes
1answer
28 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
72 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
32 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
40 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
66 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
51 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
52 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
39 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
29 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
674 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
40 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
78 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
37 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
52 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
79 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
46 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
118 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
43 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
72 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
52 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
53 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
20 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 ...
4
votes
2answers
50 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
55 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
82 views
Java login system using JSP and servlets
The system is pretty simple. Here is how the database looks:
...
0
votes
1answer
62 views
3
votes
1answer
28 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
38 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
110 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
69 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
86 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
36 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
45 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
72 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
102 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
72 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
29 views
Calculation of duration between two timestamps in different rows
In my sample data table below, all datatypes are varchar(255).
...
1
vote
2answers
75 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
63 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.
...