PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Wed May 26, 2004 6:28 am
Warning: Cannot use a scalar value as an array in c:\inetpub\wwwroot\mc\sales_form.php on line 548
what does this means?
part of my code that generate this error was...
Code: Select all
$s=2
for ($n=1; $n<=$s; $n++) {
$resultї$n] = $aї$n] * $bї$n];
}
is that we cannot use array for mathematic calculation?[/b]
magicrobotmonkey
Forum Regular
Posts: 888 Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA
Post
by magicrobotmonkey » Wed May 26, 2004 7:17 am
try putting the math in parentheses ($a[$n] * $b[$n]);
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Wed May 26, 2004 7:29 am
it dun work...
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Wed May 26, 2004 8:23 am
$a and $b are array...
help me~... is urgent~
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Wed May 26, 2004 8:26 am
Whick line exactly is 548
magicrobotmonkey
Forum Regular
Posts: 888 Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA
Post
by magicrobotmonkey » Wed May 26, 2004 8:31 am
i know they're arrays - but what are they full of?
Lord Sauron
Forum Commoner
Posts: 85 Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL
Post
by Lord Sauron » Wed May 26, 2004 9:36 am
What are the results of the following commands?
print_r($a[$n]);
print_r($b[$n]);
kevin7
Forum Commoner
Posts: 96 Joined: Fri May 21, 2004 6:54 am
Post
by kevin7 » Wed May 26, 2004 9:49 am