Jump to content

[SOLVED] When to use mysql_result?


Prodigal Son

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.

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.