Jump to content

MySQLi much different from MySQL


Mudsaf

Recommended Posts

Hello, i'm just wondering is MySQLi much different than MySQL? I have basic knowledge of MySQL and it seemed pretty similar & easy.

 

Example this

<?php$con = mysqli_connect("<hostserver>","<user>","<pass>","<database>") or die("<error>");$result = $con->query("SELECT userName FROM <users>") or die("<query_failed>");while ($row = mysqli_fetch_array($result)) {echo $row['<username>'] . "<br>";}if (isset($con)) {mysqli_close($con) or die("<some random closing problems>");}?>

PS: I know its improved extension of MySQL, but i wan't to know if there is major changes in code.

 

Ah i even might consider PDO since alot of databases supports it, would you suggest that?

http://net.tutsplus.com/tutorials/php/pdo-vs-mysqli-which-should-you-use/
Edited by Mudsaf
Link to comment
Share on other sites

codewise they are very similiar if not exact same. Procedural style has most similarity. learning PDO is worthy. I personally use PDO even though most commonly RDBMS i use is mysql.

Edited by birbal
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...