Questions tagged [pdo]
PDO is a PHP extension that serves as a data access abstraction layer for accessing databases.
334
questions
7
votes
3
answers
1k
views
A simple PHP login form with PDO
I wrote a simple PHP login form for a website. It has an initialization script, as well as a form to allow a user to login, plus a link to log the user out after logging in.
...
1
vote
1
answer
118
views
PHP Validation script
The code below is modified slightly from the code in this previous post.
I believe the code below could be improved and more secured but i don't know how so someone please show me how an improved ...
0
votes
1
answer
224
views
SQL & PHP login method
My code is working however it seems to be using old outdated php version so less secure and I'm still new to programming so I'd be more than thankful if someone shows me how an improved updated and ...
2
votes
2
answers
252
views
Best Practices for PHP PDO Pagination with Search Functionality
I'm working on implementing a pagination system with search functionality using PHP and PDO. The code I've written seems to work, but I want to ensure that I'm following best practices and avoiding ...
1
vote
0
answers
56
views
PHP PDO prepared statement with IN [closed]
Here's my code:
...
0
votes
1
answer
266
views
Can I use PDO transaction in this way? [closed]
So I want to use PDO transaction in PHP OOP where in the class are multiple insert/update queries.
If I create a new methods in Class like beginTransaction(), commit(), rollback() and I use them ...
1
vote
1
answer
387
views
Wrap INSERT statements to PDO transaction (PHP OOP)
so Im trying to wrap SQL INSERT statements to PDO transaction in PHP OOP. I don't know if I'm doing it right and this is the best/easiest way to do it.
So what is important for me is:
There can be ...
1
vote
1
answer
279
views
Is this PDO query okay to use in PHP OOP?
Do you think this code is good if I want to do a simple SQL query? Is it safe to use? Or am I doing something wrong?
...
5
votes
3
answers
274
views
DB Class extending PDO w/ other useful functions
I have this DB class that extends PDO, that also has useful functions for certain tasks; I was wondering how well it's coded, and if so, what I could maybe improve on. I tried commenting in ...
3
votes
1
answer
237
views
Proper PDO connection function
I am reviewing the database class for a live website. I am not sure if the current connect function is the best way to create a pdo object as it appears to create a new connection every time it is ...
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 ...
1
vote
1
answer
92
views
7
votes
2
answers
206
views
Connect to MYSQL database in PHP with prepared statements
I have recently learned about using PDO. I created a db class which could handle common actions like create, update, delete and select. Is this method a correct way to connect to the database using ...
3
votes
1
answer
126
views
Pagination helper class
The most nauseous problem with pagination is the fact that you have to write two almost identical queries. For the various reasons I am not inclined to use the SQL-only way (such as ...
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:
...