Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there good tutorials on how to use PDO? [closed]

Tags:

php

pdo

Maybe someone did a tutorial that shows the important thing: Setting everything up and using it with MySQL?

like image 341
openfrog Avatar asked Dec 21 '09 22:12

openfrog


People also ask

How do you write PDO?

$pdo = new PDO($dsn, $user, $passwd); A new PDO object is created. We pass the constructor the data source name and the user name and password. The PDO class represents a connection between PHP and a database server.

What is PDO method?

PDO—PHP Data Objects—are a database access layer providing a uniform method of access to multiple databases. It doesn't account for database-specific syntax, but can allow for the process of switching databases and platforms to be fairly painless, simply by switching the connection string in many instances.

Which PDO method is used to prepare a statement for execution?

Description ¶ Prepares an SQL statement to be executed by the PDOStatement::execute() method. The statement template can contain zero or more named (:name) or question mark (?) parameter markers for which real values will be substituted when the statement is executed.


2 Answers

I think the article Why you Should be using PHP's PDO for Database Access is great. It is simple, clear, and organized.

like image 151
zx1986 Avatar answered Sep 19 '22 18:09

zx1986


MySQL.com: Using MySQL with PDO
PHP.net: PHP Data Objects (PDO)

like image 40
Sampson Avatar answered Sep 21 '22 18:09

Sampson