Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

kenapa encryption not supported on sql server, wamp configure cluster, csh associative array, 12345678900 क्ष्क्ष्क्स com, mysql database storage capacity, xxxBEF.COmP.4, xxx80www, xxx80www, ksqo, como se resuelve un fatal error: function name must be a string in

Links

XODOX
Impressum

#1: Unsupported operand types

Posted on 2005-05-13 03:42:04 by DJ Craig

I keep getting this error:
Fatal error: Unsupported operand types in
/usr/local/etc/httpd/htdocs/djtricities/kat/bpmchart/chart.p hp on line
58

I've looked for hours for some type of error, and tried lots of
different things, but I can't get it to work. I did a google search
for "unsupported operand types" and for most of the people getting this
error, it was something to do with the version of PHP that they were
running, but I can't change that because it's a shared server from a
hosting company. I'm using PHP version 4.3.11 on Linux. Heres the
program around line 58:
_________________________________
function makeTable($myarray){
$result = "";
for($row = 0; $row < count($myarray); $row++){
$result .= '<tr>';
for($col = 0; $col < count($myarray[$row]); $col++){
$result .= '<td>' . $myarray[$row][$column] . '</td>';
}
$result .= '</tr>';
}
return $result;
}

function bpm($cue, $play){
//if( abs($play - 2 * $cue) < abs($play - $cue) ) $cue = $cue * 2;
//else if( abs(2*$play - $cue) < abs($play -$cue) ) $play = $play *
2;
return ((-100 * ($cue - $play))/$cue); // ***LINE 58***
}
?>
</body></html>

Report this message

#2: Re: Unsupported operand types

Posted on 2005-05-13 05:47:49 by Jerry Stuckle

DJ Craig wrote:
> I keep getting this error:
> Fatal error: Unsupported operand types in
> /usr/local/etc/httpd/htdocs/djtricities/kat/bpmchart/chart.p hp on line
> 58
>
> I've looked for hours for some type of error, and tried lots of
> different things, but I can't get it to work. I did a google search
> for "unsupported operand types" and for most of the people getting this
> error, it was something to do with the version of PHP that they were
> running, but I can't change that because it's a shared server from a
> hosting company. I'm using PHP version 4.3.11 on Linux. Heres the
> program around line 58:
> _________________________________
> function makeTable($myarray){
> $result = "";
> for($row = 0; $row < count($myarray); $row++){
> $result .= '<tr>';
> for($col = 0; $col < count($myarray[$row]); $col++){
> $result .= '<td>' . $myarray[$row][$column] . '</td>';
> }
> $result .= '</tr>';
> }
> return $result;
> }
>
> function bpm($cue, $play){
> //if( abs($play - 2 * $cue) < abs($play - $cue) ) $cue = $cue * 2;
> //else if( abs(2*$play - $cue) < abs($play -$cue) ) $play = $play *
> 2;
> return ((-100 * ($cue - $play))/$cue); // ***LINE 58***
> }
> ?>
> </body></html>
>

What's actually in $cue and $play? Try echoing them to see. I suspect
one or both is not numeric.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Report this message

#3: Re: Unsupported operand types

Posted on 2005-05-13 16:27:31 by lesperancer

shouldn't this
$result .= '<td>' . $myarray[$row][$column] . '</td>';
be
$result .= '<td>' . $myarray[$row][$col] . '</td>';

and I assume $cue is not zero
and then both $cue and $play are numerics

what's the code that calls this bpm() function look like ?

DJ Craig wrote:
> I keep getting this error:
> Fatal error: Unsupported operand types in
> /usr/local/etc/httpd/htdocs/djtricities/kat/bpmchart/chart.p hp on
line
> 58
>
> I've looked for hours for some type of error, and tried lots of
> different things, but I can't get it to work. I did a google search
> for "unsupported operand types" and for most of the people getting
this
> error, it was something to do with the version of PHP that they were
> running, but I can't change that because it's a shared server from a
> hosting company. I'm using PHP version 4.3.11 on Linux. Heres the
> program around line 58:
> _________________________________
> function makeTable($myarray){
> $result = "";
> for($row = 0; $row < count($myarray); $row++){
> $result .= '<tr>';
> for($col = 0; $col < count($myarray[$row]); $col++){
> $result .= '<td>' . $myarray[$row][$column] . '</td>';
> }
> $result .= '</tr>';
> }
> return $result;
> }
>
> function bpm($cue, $play){
> //if( abs($play - 2 * $cue) < abs($play - $cue) ) $cue = $cue * 2;
> //else if( abs(2*$play - $cue) < abs($play -$cue) ) $play = $play *
> 2;
> return ((-100 * ($cue - $play))/$cue); // ***LINE 58***
> }
> ?>
> </body></html>

Report this message

#4: Re: Unsupported operand types

Posted on 2005-05-13 17:23:19 by DJ Craig

Thanks, you were right, I was passing the bpm() function arrays. But I
still can't figure out how they got to be arrays. I used the each()
function in a while loop. Heres the code that calls the function:
while($col = each($cols)){
$rowNum = 0;
while($row = each($rows)){
$result[$rowNum][$colNum] = bpm($row, $col); //$row and $col are both
arrays here for some reason...
echo $result[$rowNum][$colNum] . '-';
$rowNum++;
}
$colNum++;
}
echo '<table>' . makeTable($result) . '</table>';

Report this message

#5: Re: Unsupported operand types

Posted on 2005-05-13 17:49:34 by Oli Filth

DJ Craig wrote:
> Thanks, you were right, I was passing the bpm() function arrays. But
I
> still can't figure out how they got to be arrays. I used the each()
> function in a while loop. Heres the code that calls the function:
> while($col = each($cols)){
> $rowNum = 0;
> while($row = each($rows)){
> $result[$rowNum][$colNum] = bpm($row, $col); //$row and $col are
both
> arrays here for some reason...
> echo $result[$rowNum][$colNum] . '-';
> $rowNum++;
> }
> $colNum++;
> }
> echo '<table>' . makeTable($result) . '</table>';

each() returns an array. See the PHP manual.

--
Oli

Report this message

#6: Re: Unsupported operand types

Posted on 2005-05-13 18:00:14 by Ewoud Dronkert

On 13 May 2005 08:49:34 -0700, Oli Filth wrote:
>> while($col = each($cols)){
>
> each() returns an array. See the PHP manual.

Yeah, http://php.net/each or try http://php.net/foreach


--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/

Report this message

#7: Re: Unsupported operand types

Posted on 2005-05-13 19:03:36 by DJ Craig

Thanks, I've got it working now :-)

Report this message