Jump to content

Recommended Posts

Quick question, when do I use mysql_result? Php.net says mysql_fetch_array and the alike are much much faster. How about if I am just grabbing one cell value? Currently I am using mysql_fetch_assoc on almost everything, even if its just one cell or row. Will mysql_result be better in that case? Or maybe another one of those differences you won't even notice?

 

Edit: Oh yea, also I am using count(*) when counting rows, should I be using count(colname) instead? Is it faster?

Link to comment
https://forums.phpfreaks.com/topic/117710-solved-when-to-use-mysql_result/
Share on other sites

mysql_result is only really useful in a circumstance where you want to loop through results but inside the loop, you want to "look ahead" to a row/col further down the result list.  I guess this is useful, but honestly I have yet to have need of it.

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.