The following might help you to distinguish these concepts.<br><br>Consider any kind of real world entity, e.g. a student, a school, a book, a patient, etc. Now think about its attributes. For a book this might be title, author, year, isbn, price... When we model such an entity using a computer, we specify a set of attributes. This is a "record". It is just a collection of attributes describing an entity.<br>
<br>A record could be stored on disk (e.g. as a row of a relational database table, or as a row of a CSV file), or represented in volatile memory in a data structure in a running program. Perhaps the most common data type used for representing a record is an "associative array" ("hash" in Perl; "dictionary" in Python; "array" (!) in PHP, "map" in C++); some languages support a "tuple" type which is also appropriate for representing records. However, at one level these details don't matter. What's important is just that we have a set of attributes.<br>
<br>Now consider any collection of entities of the same type, e.g. students, schools, books, patients, etc. When we model these in a computer, we specify a collection of like entities. This is just a set or list of entities.<br>
<br>This list could be stored on disk (e.g. as a relational table, or a CSV file), or represented in a running program. The most common data type is an "array", and that's what it is called in most languages (but it is "list" in Python). Some languages encourage you to define array elements to be all of the same type, but not all. In general, I think this is a good practice.<br>
<br>PHP blurs the distinction between records and arrays. However, a programmer can use <font size="2">PHP</font> in such a way to keep them quite distinct:<br><pre>my_record1 = array('isbn'=>1441412050, 'title'=>'Alice in Wonderland', 'author'=>'Lewis Carroll');<br>
my_record2 = array('isbn'=>1441412050, 'title'=>'Through the Looking Glass', 'author'=>'Lewis Carroll');<br><br>my_array = array(my_record1, my_record2);<br><font size="2"><span style="font-family: arial,helvetica,sans-serif;"></span></font><br>
<br>my_record1['isbn']; /* access a record's attribute by name */ <br>my_array[1]; /* access an array's element by index */<br><br></pre><div class="gmail_quote">I hope this helps!<br><br>--<br>
Steven Bird<br><a href="http://stevenbird.me/">http://stevenbird.me/</a><br><br></div>