Skip to main content

Questions tagged [pdo]

PDO is a PHP extension that serves as a data access abstraction layer for accessing databases.

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. ...
whiteman808's user avatar
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 ...
Bebo's user avatar
  • 39
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 ...
Bebo's user avatar
  • 39
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 ...
user275476's user avatar
1 vote
0 answers
56 views

PHP PDO prepared statement with IN [closed]

Here's my code: ...
neubert's user avatar
  • 111
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 ...
kviktor1230's user avatar
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 ...
kviktor1230's user avatar
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? ...
kviktor1230's user avatar
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 ...
Crimin4L's user avatar
  • 153
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 ...
jdf's user avatar
  • 31
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 ...
kviktor1230's user avatar
1 vote
1 answer
92 views

batchUpdate using pdo and MSSQL

...
Sayaman's user avatar
  • 446
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 ...
Sanidhya's user avatar
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 ...
Your Common Sense's user avatar
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: ...
John Beasley's user avatar

15 30 50 per page
1
2 3 4 5
23