At 5:22 PM -0500 1/17/01, Ignacio Vazquez-Abrams wrote:
>
>Um, no. $relationsresult isn't an array, it's a MySQL result resource. Use
>mysql_data_seek() instead.
>
Ah! I get it!
mysql_data_seek($relationsresult,0);
does what I need it to do.
Thanks, everyone!
-Maurice
--
Maurice Ric
Getting off topic maybe so I'll keep it short.
> The array pointer can be pretty useful.
True, but unexpected for the perl programmer/novice PHP geek.
> ie. give me the second last element of an array:
This can be done in perl ("standard" arrays) with $array[@array-2]
> Or have it tell you w
At 4:22 PM -0600 1/17/01, Darryl Friesen wrote:
>> $relationsresult = mysql_query($relationsquery) or die(mysql_error());
>>
>> while ($relationsrow = mysql_fetch_array($relationsresult)) {
>>
>> $thischild = $relationsrow["childsku"];
>> if ($thevalue == $thischild) {
>> echo " checked";
>>
On Wed, 17 Jan 2001, Maurice Rickard wrote:
> Thanks! This is starting to make sense...although when I try to
> reset what I thought was my array, I get the "Variable passed to
> reset() is not an array or object" error message. Here's the
> relevant code:
>
> $relationsquery = "select * from r
> $relationsresult = mysql_query($relationsquery) or die(mysql_error());
>
> while ($relationsrow = mysql_fetch_array($relationsresult)) {
>
> $thischild = $relationsrow["childsku"];
> if ($thevalue == $thischild) {
> echo " checked";
> }
>
> } // end while for relations loop
>
> reset($relationsr
Thanks! This is starting to make sense...although when I try to
reset what I thought was my array, I get the "Variable passed to
reset() is not an array or object" error message. Here's the
relevant code:
$relationsquery = "select * from relations where
childtype='$childtype' and parenttype
> > What I'm getting is that the inner while loop executes on the first
> > execution of the outer while, and then not at all. How would I get
> > it to execute each time?
>
> Coming from a perl background, I got stuck there too when I started using
> PHP. PHP has this odd notion of an array poi
> What I'm getting is that the inner while loop executes on the first
> execution of the outer while, and then not at all. How would I get
> it to execute each time?
Coming from a perl background, I got stuck there too when I started using
PHP. PHP has this odd notion of an array pointer. Afte
8 matches
Mail list logo