Questions tagged [pdo]

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

Filter by
Sorted by
Tagged with
5
votes
2answers
545 views

moving from->to: mysql->pdo, md5->pbkdf2, procedural->oop

I'm upgrading/rewriting our online client portal and wondering if my log in page code looks okay so far. during this rewriting/learning process I am upgrading a number of things: PHP 5.2 to 5.3.5, ...
3
votes
2answers
89 views

Secure row insertion using a position-based prepared statement

I have the following function to insert a new row into a table: ...
7
votes
2answers
1k views

PDO wrapper structure

Is this PDO wrapper structure dynamic? Can using self:: rather than $this cause problems? ...
1
vote
1answer
4k views

PHP PDO wrapper class

I'm one of those coder/designers that has been at it since day one, but is still getting the hang of several important coding nuances (e.g. OOP for PHP, and concepts such as this). In this case, I'm ...
4
votes
3answers
9k views

Custom login system (PDO, sanitizing, hash)

I have made a custom login form for my site, with the help of PDO (until now I used simple MySQL connection and sanitizing), and it looks like this: ...
2
votes
2answers
776 views

Basic user registration code in PHP: Part 2

This is continuation and implementation of feedback found in this post: Basic user registration code I just began to use the PDO object, I'm not sure if i'm using it efficiently. Are there any ...
1
vote
1answer
657 views

PDO MySQL class

I'm new to using PDO and am trying to create a secure class to handle MySQL statements. Here is what I have so far: ...
0
votes
2answers
120 views

User lib php v2

I've been working some forth looking on design patterns, and I would like some help to improve the code (fixes, tips, just generally improvements, or things you consider bad practise, etcetera in my ...
4
votes
1answer
1k views

Using PHP's __call() to emulate a Class instead of Extending

I recently started working on a project that had been dropped by the previous dev. When looking through the existing code, I came across this singleton Database Class. ...
2
votes
1answer
340 views

Updating only certain fields on a database row

I have data that I want to insert in a database. Sometime a piece of data is already in the database, so I just want to update the fields that changed. For example, if I insert these rows one after ...
2
votes
1answer
3k views

PHP DAO classes inherit from a generic DAO classes and only change the table name

I am building a web app that needs to access various tables in a given MySQL db. To do that, I have created a generic class, see DAO_DBRecord.php below, and I ...
4
votes
2answers
4k views

PDO (MySQL) connection and query class, safety and logic

For the last few day I tried to figure out how to work with MySQL and PDO. Although I've tried to read a lot about the subject, there are still a lot of things I don't understand. Because of this ...
4
votes
1answer
2k views

PDO wrapper class

Connection stored in the xml config file. ...
2
votes
1answer
679 views

MySQL PDO class

Please give me any comment about these codes. Does it enough to prevent SQL injection? What I have to do to make the code better? ...
12
votes
3answers
4k views

PHP PDO Database Abstraction Layer

I'd like to get some feedback on a PHP Database Abstraction Layer I've created. It's a little long, but there really wasn't a way to just post part of it. Here is the base ...
6
votes
2answers
4k views

PDO wrapper class

...
4
votes
2answers
2k views

How can I improve this PHP MySql Rank generation function?

How can I improve this PHP MySql Rank generation function? (Mostly looking to improve speed, but any feedback is very welcome) Right now I keep stats and ranks in 2 separate tables. The only ...
4
votes
1answer
729 views

Implementing PDO, code correct so far?

I have decided to go PDO and have started implementing it on one of my webprojects. I have limited programing skills but can usually pull it off with some tutorials and forums. Here is my code this ...
8
votes
5answers
13k views

Database class using PDO

The point of this question I'm actually using it while developing a simple application and it seems to cover all my needs. Also it uses PDO so that we don't really have to worry about SQL Injection. ...
9
votes
1answer
436 views

Database method to query

I have a database class that in __construct() initialize a PDO connection and insert the instance into a $db private var. Now i'm working on a method that can be ...

1
3 4 5 6
7