Jump to content

[SOLVED] Mysqli vs Mysql


PHPTOM

Recommended Posts

Hi,

I have always used MySQL, but I might switch to MySQLi. I'm planning a new application I am making but I don't know whether to use MySQLi or MySQL. How do you do things like mysql_fetch_array with mysqli? Is this how you do a query? :

$query = $mysqli->query("SELECT * FROM `table`");

I do understand some of it, like $mysqli would have to be a

$mysqli = new Mysqli;

something like that.

 

Thanks a lot

 

----------------

Now playing: Chris Brown - Forever

via FoxyTunes

Link to comment
https://forums.phpfreaks.com/topic/119342-solved-mysqli-vs-mysql/
Share on other sites

Yes I use OOP that's why I though MySQL would be better. Can I just stick a while on that then? like the same way I can do with mysql_fetch_array()?

while($row = $result->fetch_array(MYSQLI_ASSOC)){
echo $row[username]; //for example
}

 

----------------

Now playing: Deep Purple - Smoke On The Water

via FoxyTunes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.