Results 1 to 7 of 7

Thread: what is the difference between mysql_fetch_row and mysq_fetch_array

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Answers
    4

    Question what is the difference between mysql_fetch_row and mysq_fetch_array

    My Question About PHP functions the differences between mysql_fetch_row() and mysql_fetch_array().
    "mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP official manual. However, I can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.


    "enumerated array" equal to "numeric array"?


    Last edited by admin; 01-07-2013 at 04:40 AM.

  2. #2
    Moderator
    Join Date
    Oct 2005
    Answers
    305

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array

    In an enumerated array each column is stored in an array offset starting from 0 (zero).
    Elements of the enumerated array are number.

    For example, See the output of both mysql_fetch_row, mysql_fetch_array and mysql_fetch_assoc for a query that out puts two fields client_id and client_name

    mysql_fetch_row
    Array ( [0] => 3 [1] => ABC Solutions )

    mysql_fetch_array
    Array ( [0] => 3 [client_id] => 3 [1] => ABC Solutions [client_name] => ABC Solutions )

    mysql_fetch_assoc
    Array ( [client_id] => 3 [client_name] => ABC Solutions )


  3. #3
    Junior Member
    Join Date
    Jan 2013
    Answers
    4

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array




  4. #4
    Junior Member
    Join Date
    Jan 2013
    Answers
    4

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array

    Quote Originally Posted by Lokesh M View Post
    In an enumerated array each column is stored in an array offset starting from 0 (zero).
    Elements of the enumerated array are number.
    I am so confused.With the part color of red, if i use the while loop to fetch all the records,then i can use the numeric index to get the elements.
    So that ,whether an enumerated array equal to a numeric array.


  5. #5
    Moderator
    Join Date
    Oct 2005
    Answers
    305

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array

    Yes by definition of Numeric array - An array with a numeric index, enumerated array can be said be numeric array.


  6. #6
    Junior Member
    Join Date
    Jan 2013
    Answers
    4

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array

    Thank you! Lokesh M


  7. #7
    Junior Member
    Join Date
    Apr 2013
    Answers
    19

    Re: what is the difference between mysql_fetch_row and mysq_fetch_array

    So mysql_fetch_row() and mysql_fetch_array() can be used in place of each other? Are they interchangeable?


  8.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact