Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.