473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Fatal Error: Unsupported operand types.

5
I'm a beginner at php and studying at a university.

I need to write a script which outputs the $afdeling and the corresponding "summed up" $omzet.

Then I need to output the $afdeling that has the most $omzet. //Don''t have this yet.

I wrote this using an example explaining a similar thing.

Since, I'm a beginner I can't find the error or know what is wrong.

I'm getting the error around on line 12.
This is what I have uptil now.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $omzet[0] = array(10, 13, 16, 9, 19, 18);     
  3.     $omzet[1] = array(9, 12, 18, 6, 21, 11);    
  4.     $omzet[2] = array(6, 5, 8, 17, 15, 20);
  5.     $omzet[3] = array(13, 12, 15, 23, 19, 22);
  6.     $omzet[4] = array(11, 11, 11, 16, 7, 14);
  7.     $omzet[5] = array(14, 14, 13, 18, 9, 20);
  8.     $afdeling = 1;
  9.     for($i=0; $i<6; $i++){    
  10.         $totaal = 0;    
  11.         while($omzet[$i] <> 99){
  12.             $totaal = $totaal + $omzet[$i];
  13.         }
  14.     $totaal = $totaal;
  15.     echo "Het totale omzet bedrag van afdeling " .$afdeling. " is " .$totaal. ". \n";
  16.     $afdeling = $afdeling + 1;
  17.     }
  18. ?>

Thanks in advance for the help.
Sep 23 '11 #1

✓ answered by zero 0

YES, got the first error. Had to put in the array, from the first 6 variables, ", 99" as the last number, else it couldnt use the "not equal"-operator I guess.. xD
Now for echo-ing the $afdeling with the highest value. :)

3 2406
Rabbit
12,516 Expert Mod 8TB
The not equal operator is !=
Sep 23 '11 #2
zero 0
5
That's not the error.
not equal can be written like != or <>
Sep 23 '11 #3
zero 0
5
YES, got the first error. Had to put in the array, from the first 6 variables, ", 99" as the last number, else it couldnt use the "not equal"-operator I guess.. xD
Now for echo-ing the $afdeling with the highest value. :)
Sep 23 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: DJ Craig | last post by:
I keep getting this error: Fatal error: Unsupported operand types in /usr/local/etc/httpd/htdocs/djtricities/kat/bpmchart/chart.php on line 58 I've looked for hours for some type of error, and...
3
by: Martin Koekenberg | last post by:
Hello, Ik get the following error when I install a new Python software package such as Zope or PIL. This is what I get whem I 'make' Zope : running build_ext Traceback (most recent call...
3
by: Rakesh | last post by:
In my Python code fragment, I want to write a code fragment such that the minimum element of a tuple is subtracted from all the elements of a given tuple. When I execute the following python...
3
by: yaffa | last post by:
hey folks i get this error: Python interpreter error: unsupported operand type(s) for |: when i run this line of code: for incident in bs('tr', {'bgcolor' : '#eeeeee'} | {'bgcolor' :...
3
by: tanusreesen | last post by:
Hi All, I am completely new to python programming language.I was trying to write a program on class.But I am getting this error.Can someone please help me to solve the error I am facing.I...
1
by: Florian Lindner | last post by:
Hello, I get the exception above when trying to use a float as radix and exponent, e.g.: Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: unsupported operand type(s)...
8
by: Gilbert Fine | last post by:
This is a very strange exception raised from somewhere in our program. I have no idea how this happen. And don't know how to reproduce. It just occurs from time to time. Can anyone give me some...
2
by: Jordan Harry | last post by:
I'm trying to write a simple program to calculate permutations. I created a file called "mod.py" and put the following in it: def factorial(n): a = n b = n while a>0 and b>1: n = (n)*(b-1)...
1
by: flapjacks | last post by:
line1 = ((0.0, -1.0), (1.0, 1.0), (2.0, 3.0), (3.0, 5.0), (4.0, 7.0), (5.0, 9.0), (6.0, 11.0), (7.0, 13.0), (8.0, 15.0), (9.0, 17.0)) line2 = ((0.0, 2.0), (1.0, 1.0), (2.0, 0.0), (3.0, -1.0), (4.0,...
2
by: pinz | last post by:
I am making a simple vote system with yes/no radio buttons and a submit button. On submit it sends users choice to a php file - to be increased by one, related to users input. First it fetches the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.