PDO Convert

Started by Laur[1], September 12, 2013, 01:39:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

Agreed, was curious like.

elephant

Quote from: Laur[1] on October 04, 2013, 04:19:50 PM
Not realy, just eager to learn more stuff

As good a reason as any.

Laur[1]

Quote from: elephant on October 03, 2013, 10:23:34 PM
It is better than the mysql extension and gaining more popularity than mysqli, but before you invest the time working on it - do you really need a database independent interface?

Not realy, just eager to learn more stuff

elephant

It is better than the mysql extension and gaining more popularity than mysqli, but before you invest the time working on it - do you really need a database independent interface?

Laur[1]

Yes, i heard it's much better than using MySql/MySqli but need to learn it better :o

Mindless

Why PDO - Thats odd you have chosen that ?

Laur[1]


flyordie

There is none! That is why you use prepared statements.

$id = $_POST['id'];;
$stmt = $conn->prepare('SELECT * FROM clients WHERE id = ?');
$stmt->execute(array($id));
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($rows);


Additionally, I would suggest you take a look at these tutorials to lean more:
http://net.tutsplus.com/tutorials/php/php-database-access-are-you-doing-it-correctly/

And
http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers

Laur[1]

Hello, I want to convert the 09 to PDO insteal of MySql what is the equivalent of mysql_real_escape_string to PDO  :o