Showing results for 
Search instead for 
Did you mean: 

Converting mysqli to PDO?

I've been out of the coding scene for about 10 years and I'm trying to catch back up. Much of what I learned has been deprecated or full-out removed and now there's so much emphasis on security (which there should be), but I'm used to the old mysql_query.

I started making everything as mysqli_query because that's what I was reading about, but recently I've reading a lot about PDO and that it's more secure and less typing. To be honest, it looks exactly the same as mysqli to me, but that's just a cursory glance.

Anyway, enough chattering, my main reason for this is that I'm a little confused on how to do PDO. Some examples that I have are:

$stmt = mysqli_prepare($conn, $sql)

That one is easy because it just turns into:

$stmt = $pdo->prepare($conn, $sql)


So how about replacing things like mysqli_stmt_bind_param or mysqli_stmt_execute?

I'm not asking for anybody to do it for me, but I guess the better question is... does anybody know a good place to learn how to convert mysqli to PDO? Or I guess maybe to learn PDO?