All Questions
35
questions
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 ...