The following archives are provided as a public service to the community. Opinions archived here do not necessarily represent the opinions of Open for Business or its contributors.
David McGlone wrote:
> $query = "SELECT * FROM subheaderText";
> $result= mysql_query($query);
> $num = mysql_fetch_array($result);
> $num=0;
> while ($num < $result){
> echo "$subheaderTextID<br>";
> $num++;
> echo $num;
> }
> this query echo's back: 12345.
>
> In the above code, I believe that $result should contain all 6 rows
$result does not contain all 6 rows; $result is a "resource"; an object
you can send to other mysql functions (like mysql_fetch_array); but it
has no meaning within php itself.
If you insert/remove a call to any mysql function before the above code;
you will get different results from this loop.
| Home |