Jump to content

Use PDO for mysql or standar mysql functions?

- - - - -

  • Please log in to reply
7 replies to this topic

#1
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Hi guys

for PHP and MySQL
use PDO is better or Standard mysql functions?

thank you

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
The standard MySQL functions in PHP have not changed nearly in a decade, they are essentially the basic function line to perform any task. MySQLi and PDO provide abstraction and more powerful options for working with a database, I would recommend them over the older set.

I've actually got a tutorial on PDO reference if you already know the older MySQL functions here:
http://forum.codecal...bstraction.html
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Thank you alexander
MySQLi and PDO is better yeah?

Different "MySQL" and "MySQLi" is what? what's better?

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
The i in mysqli stands for improved, so it (hopefully) is better.

PDO is a larger database class than MySQLi, although it really depends on what you need. They both can be used in very similar ways, feel free to look at my tutorial and use it if you like the way it looks. PDO would be the option if you were looking for a more advanced extended class for databases.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Thank you

Can you give me a full class for PDO and MySQLi?

I need this.

#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
It is an internal class, although you can find the documentation on my tutorial or here:
PHP: PDO - Manual
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
i cant found mysqli and pdo

found only mysql with pdo

please help

#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
MySQLi can be found on the official PHP site, with its official manuals.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users