I've got a mysql statement which grabs only one record according to an id. I wish to determine if using mysql_fetch_row or something like that like that's better then using similar to mysql_fetch_array, just for getting one row inside a database.

It might appear like good sense to choose the mysql_fetch_row but Among the finest to make certain.

An essential factor to notice is the fact that using mysql_fetch_array() is not considerably reduced than using mysql_fetch_row(), while it possesses a significant added value.


why not only use LIMIT 1 within the mysql statement and regardless of what you'll have one row.

The 2 functions are almost identical, the title is simply causing you to think it's different:

$r=mysql_query('SELECT name,email FROM tbl LIMIT 1');
    // array('name'=>[dbName], 'email'=>[dbEmail]);
    // array([dbName], [dbEmail]);
    // It's a normal incremental integer index array
    // same as mysql_fetch_assoc();
    // same as mysql_fetch_row();
    // array(0=>[dbName], 1=>[dbEmail], 'name'=>[dbName], 'email'=>[dbEmail]);

The manual also indicates performance smart the 2 functions worked out well. Local tests hint within the same direction. I'd suggest explore be worried about the .0001 time/memory saved and discover true bottlenecks inside your programs.