Skip to main content

All Questions

Tagged with
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 ...
Tania Rascia's user avatar
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,...
lightning_missile's user avatar
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. ...
stack's user avatar
  • 143
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: ...
stack's user avatar
  • 143
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. ...
Marco's user avatar
  • 91
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. ...
Adam Copley's user avatar
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 ...
Andurit's user avatar
  • 245
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 ...
Jimmy's user avatar
  • 473
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 ...
sanoj lawrence's user avatar
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? ...
user avatar
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. ...
Qwiso's user avatar
  • 73
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? ...
craig's user avatar
  • 21
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 ...
Carlos Arturo Alaniz's user avatar
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: ...
Viscocent's user avatar
  • 166
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 ...
Michael Benneton's user avatar

15 30 50 per page