All Questions
35
questions
1
vote
0
answers
56
views
PHP PDO prepared statement with IN [closed]
Here's my code:
...
1
vote
1
answer
74
views
Updating multiple database tables when products are shipped back by customer
So, in this example I have to make these changes in my tables:
Select Product Data => SKU, QTY
Insert into shipping_back table
Update in shipping_back to current date
Update in customers to ...
4
votes
2
answers
205
views
Using a transaction to create account records
This is my first time using commit and rollback. I just need to know if this is a proper execution of the functions for this particular situation:
...
5
votes
1
answer
144
views
Storing and confirming user input
I am a beginner, and I'm trying to secure a sign-login system on my website. Is my code good/enough to prevent SQL injection?
THIS IS THE SIGN FILES
This is the index.php that takes user input:
...
3
votes
1
answer
806
views
Does PDO::quote helps me to protect me against sql injection?
I have to process raw sql user input with Laravel. I've backed them up as follows:
...
1
vote
1
answer
83
views
Reduce database touches for one to many data pull
I have the following function which works properly and returns all of the rows from a specific table, then loops through each row to add data related to it as a subarray.
...
1
vote
1
answer
101
views
Displaying a paginated list of forum topics using PHP PDO [closed]
Can someone tell me if this code is safe? Can be sql-injected or something else hacked? Code get some rows from db and show in pages with pagination... if i can improve let me know and show me how, ...
2
votes
2
answers
84
views
ORM class for Posts
I'm new to PHP OOP and I'm making some tests. I have 2 classes: database and posts and the two interact with each other.
Class Database:
...
3
votes
1
answer
1k
views
PHP + PDO - Inserting data on the table with a loop
First of all i made a simple code to insert data on my table, with the information from this code i made a loop to insert data on another table for a notification system.
I'm new to PHP and i think ...
2
votes
1
answer
89
views
2
votes
2
answers
101
views
1
vote
1
answer
4k
views
PDO Dynamic query builder
I'm trying to improve my php oop programming skills. As an exercise I wrote this class that will generate and execute dynamic sql queries. I've also writed a class to call various sanitization filters ...
4
votes
3
answers
345
views
PHP Signup & Login
I want everything to be well and secure with my authentication code. I've done many signup and login systems before but just for testing purposes, and didn't take into consideration all the security ...
1
vote
1
answer
62
views
Insert and update SQL entries for posts to be accessed by up to 3 other users
At first, I have this HTML I use here:
body {
text-align: center;
}
...
1
vote
2
answers
525
views
PHP PDO statements
I wrote a piece of code. and to be honest it seems a bit messy so I would like some opinions on it, and if I can make it cleaner. Or if there are better ways to do it:
...
5
votes
2
answers
1k
views
Inserting users using PDO prepared statements
I made a small script to update fields in a database. I'm using PDO to connect to MySQL. All the business logic of PHP is in the top half of the file, and the form is at the bottom.
Here is the full ...
1
vote
1
answer
820
views
Data Access Layer (object oriented)
I am using a global class (like a global model) that acts like a sql abstraction layer for my application. I am using it without problems now, but since the application I am creating is getting bigger,...
2
votes
2
answers
108
views
Checking a user's emails using an ID
I'm trying to do this:
Getting user's ID based on his email name.
Using that user_id to check all his emails that have been sent for him so far.
...
1
vote
5
answers
1k
views
A like/unlike system using MySQL and PDO
I have created a Like/Unlike system. The user clicks one to indicate a "like", and clicks again to "unlike" it. Currently I do that like this:
...
1
vote
2
answers
3k
views
Select random row using PDO
What do you think of this way to generate a random number from the total rows in a table? I would like to create a page that random.php precisely generates a random ID and shows it.
...
2
votes
2
answers
1k
views
PHP Dynamic QueryBuilder function - Security
This function is a working function, which builds a number of queries depending on the values of $_POST.
...
5
votes
1
answer
386
views
Tools for transferring data from an API to a database
I explain everything on my current code but this question is more general "HOW TO" work correctly with this in this case but even next time.
I have 4 methods in my class, each does something but in ...
2
votes
2
answers
416
views
A simple PHP login system
I'm super new to PHP and I'm trying to get a functional login system together. This is the code I have:
class/user.php
...
2
votes
1
answer
534
views
Securing a form with image uploads
I am using PDO prepared statements to store user entered input and store that input to the database. The code will store a text input and 5 uploaded images.
Will this code protect from data SQL ...
10
votes
4
answers
837
views
Listing products from a database
I've this function to list products from database by category. I'm using prepared statements, but wouldn't this make it pretty pointless to use them?
...
4
votes
1
answer
22k
views
Converting entire table to JSON data. Is there a better way?
Building a 'card' database: I'm simply learning to take input data and store to database. Incorporating JSON, PDO, SQL, and enforcing my general coding skills through PHP, hopefully.
...
2
votes
3
answers
279
views
Remove vulnerabilities from query on public website [closed]
I think that the following query is preventing against SQL injection, but what other measures do I need to take to ensure my queries are 100% safe from any malicious attacks?
...
3
votes
1
answer
220
views
Fetching and formatting content from a database
I've wrote this script to fetch and format content from my DB. It also counts how many result there are and separates them into pages. I'm barely learning PHP and MySQL so I don't know much about ...
3
votes
1
answer
250
views
Code Reiview for an PHP PDO Queries? is there a better way to do it?
so this is my code for a equipping an item in my game dev't:
...
5
votes
1
answer
2k
views
PHP Login Authentication with BCrypt
I have a php authentication script and everything works fine, but I'm very unsure about the way I programmed it (I hardcoded some things). I was hoping stack could look through this and point out any ...