On Sunday April 5 2015 10:56, in comp.lang.php, "richard"
<
nor...@example.com> wrote:
> On Sun, 5 Apr 2015 01:15:55 +0000 (UTC), Doug Miller wrote:
>
>> richard <
nor...@example.com> wrote in
>> news:1lpvv6118algy.1pzxv594x426f$.dlg@
40tude.net:
>>
>> [...]
>>>
>>> Done that.
>>> What I get is 11 duplicates of the first item.
>>> So why does it stop at 11 when I have 200 records?
Because you are doing it wrong. See the comments below.
>> Kind of hard to answer that question when we can't see your code....
>
> $result = mysqli_query($link,"SELECT * from sixty where (
> (peak='1')
> and (year>1959)
> and (year<1970)
> ) ORDER BY year, sid ");
> $rows = mysqli_fetch_assoc($result);
mysqli_fetch_assoc() populates an associative array with *a SINGLE row* of
the resultset.
> $total=count($rows);
> echo $total; // displays "11"
You have eleven columns in the fetched row.
> echo "<br>";
> echo $rows['title']; //displays nothing.
Do you have a table column named 'title'?
To get the entire table, you have to do something like
$result = mysqli_query($link,"SELECT * FROM sixty
WHERE ((peak='1') AND (year>1959) AND (year<1970))
ORDER BY year, sid ");
$total = mysqli_num_rows($result);
echo $total;
while ($rows = mysqli_fetch_assoc($result))
{
echo "<br/>"
echo $rows['title'];
}
--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request