Questions tagged [pdo]

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

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
47 views

Mysql PDO Wrapper that throws Unique Constraint Exception

The main reasoning behind this PDO wrapper, is that I find myself using unique constraints quite frequently in my designs, and I have ...
3
votes
2answers
129 views

Sanitize vars on form submit

I have this code and I would like to know if I filtered my code correctly. I am practicing my security coding for a system that I am working on and I would like to know if I am doing it the right way. ...
2
votes
0answers
140 views

PHP Secure Remember Me for Login using PHP Session and Cookies with referer url

I have followed a mysqli tutorial to create a login with cookies and session with remember me authentication in pdo. in tutorial class had a new db_connection, I ...
2
votes
0answers
285 views

PHP Login Checker Stage

I have been working on my script which allows people to sign-up and login to my website. I was wondering if someone could review the code. It works but I can't help but feel it could be optimized. ...
1
vote
0answers
476 views

PHP PDO user class

I'm working to implement an users management class inside an already existing project, so I wrote this simple code that will be called from a controller who is responsable to hash the password and ...
1
vote
0answers
152 views

Very simple RESTful API dispatching in PHP

This code is meant to be a very simple RESTful API. The simple router takes the URI request and maps it to a function with a matching name. E.g. www.domain.com/bill maps to function bill(). Then bill ...
1
vote
0answers
47 views

Nightly script to update database

I have a portion of a script here, and the whole script works just fine. However, I feel like it's inefficient and may work better in a class/function format. This is a script scheduled to run every ...
1
vote
0answers
600 views

Printing many-to-many relationships in an HTML/bootstrap table

I need to print the many-to-many relation ship in my tablet. However, I don't know what to do for my case: I tried tons of ideas, however, I may have done something wrong because nothing worked. Here ...
1
vote
0answers
160 views

Simple data-fetching and conversion into JSON using two different patterns

I'm trying to fetch and convert data into JSON format. Some days ago I was using MySQLi but someone told me this is susceptible to SQL injections when I asked a question for code review. Now I'm ...
1
vote
0answers
125 views

Create and access database connection

I'm working on an MVC project and I'm writing the code for get access to the database connection. I have two files: The first (PdodbLib.class.php) extends PDO: <...
1
vote
0answers
103 views

Folder model controller view

I'm using a slim router and have made a folder model controller view. Below is one of my model files. I made one database with one model. I have some problem in my project: there are several ...
-1
votes
1answer
1k views

Mysql flexible insert record with bind_param or bind_value

I want to insert rows in a database table with the precaution of SQL-injection. I'm using below flexible MySQL insert function, which enters a record in a given table. Is this the best approach or is ...